formatting
Some checks failed
CI / Foundry project (push) Has been cancelled

This commit is contained in:
Ciara Nightingale 2025-02-07 10:00:33 +00:00
parent 5b65dfcc38
commit 878bd34ef6
4 changed files with 22 additions and 20 deletions

View File

@ -28,9 +28,7 @@ contract LikeRegistry is Ownable{
profileNFT = SoulboundProfileNFT(_profileNFT); profileNFT = SoulboundProfileNFT(_profileNFT);
} }
function likeUser( function likeUser(address liked) external payable {
address liked
) external payable {
require(msg.value >= 1 ether, "Must send at least 1 ETH"); require(msg.value >= 1 ether, "Must send at least 1 ETH");
require(!likes[msg.sender][liked], "Already liked"); require(!likes[msg.sender][liked], "Already liked");
require(msg.sender != liked, "Cannot like yourself"); require(msg.sender != liked, "Cannot like yourself");

View File

@ -6,7 +6,6 @@ import "@openzeppelin/contracts/access/Ownable.sol";
import {Base64} from "@openzeppelin/contracts/utils/Base64.sol"; import {Base64} from "@openzeppelin/contracts/utils/Base64.sol";
import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/Strings.sol";
contract SoulboundProfileNFT is ERC721, Ownable { contract SoulboundProfileNFT is ERC721, Ownable {
error ERC721Metadata__URI_QueryFor_NonExistentToken(); error ERC721Metadata__URI_QueryFor_NonExistentToken();
error SoulboundTokenCannotBeTransferred(); error SoulboundTokenCannotBeTransferred();
@ -91,10 +90,16 @@ contract SoulboundProfileNFT is ERC721, Ownable {
Base64.encode( Base64.encode(
bytes( // bytes casting actually unnecessary as 'abi.encodePacked()' returns a bytes bytes( // bytes casting actually unnecessary as 'abi.encodePacked()' returns a bytes
abi.encodePacked( abi.encodePacked(
'{"name":"', profileName, '", ', '{"name":"',
profileName,
'", ',
'"description":"A soulbound dating profile NFT.", ', '"description":"A soulbound dating profile NFT.", ',
'"attributes": [{"trait_type": "Age", "value": ', Strings.toString(profileAge), '}], ', '"attributes": [{"trait_type": "Age", "value": ',
'"image":"', imageURI, '"}' Strings.toString(profileAge),
"}], ",
'"image":"',
imageURI,
'"}'
) )
) )
) )

View File

@ -32,7 +32,6 @@ contract SoulboundProfileNFTTest is Test {
vm.prank(user); vm.prank(user);
vm.expectRevert("Profile already exists"); vm.expectRevert("Profile already exists");
soulboundNFT.mintProfile("Alice", 25, "ipfs://profileImage"); soulboundNFT.mintProfile("Alice", 25, "ipfs://profileImage");
} }
function testTokenURI() public { function testTokenURI() public {