This commit is contained in:
parent
5b65dfcc38
commit
878bd34ef6
@ -28,9 +28,7 @@ contract LikeRegistry is Ownable{
|
||||
profileNFT = SoulboundProfileNFT(_profileNFT);
|
||||
}
|
||||
|
||||
function likeUser(
|
||||
address liked
|
||||
) external payable {
|
||||
function likeUser(address liked) external payable {
|
||||
require(msg.value >= 1 ether, "Must send at least 1 ETH");
|
||||
require(!likes[msg.sender][liked], "Already liked");
|
||||
require(msg.sender != liked, "Cannot like yourself");
|
||||
|
||||
@ -6,7 +6,6 @@ import "@openzeppelin/contracts/access/Ownable.sol";
|
||||
import {Base64} from "@openzeppelin/contracts/utils/Base64.sol";
|
||||
import "@openzeppelin/contracts/utils/Strings.sol";
|
||||
|
||||
|
||||
contract SoulboundProfileNFT is ERC721, Ownable {
|
||||
error ERC721Metadata__URI_QueryFor_NonExistentToken();
|
||||
error SoulboundTokenCannotBeTransferred();
|
||||
@ -91,10 +90,16 @@ contract SoulboundProfileNFT is ERC721, Ownable {
|
||||
Base64.encode(
|
||||
bytes( // bytes casting actually unnecessary as 'abi.encodePacked()' returns a bytes
|
||||
abi.encodePacked(
|
||||
'{"name":"', profileName, '", ',
|
||||
'{"name":"',
|
||||
profileName,
|
||||
'", ',
|
||||
'"description":"A soulbound dating profile NFT.", ',
|
||||
'"attributes": [{"trait_type": "Age", "value": ', Strings.toString(profileAge), '}], ',
|
||||
'"image":"', imageURI, '"}'
|
||||
'"attributes": [{"trait_type": "Age", "value": ',
|
||||
Strings.toString(profileAge),
|
||||
"}], ",
|
||||
'"image":"',
|
||||
imageURI,
|
||||
'"}'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@ -32,7 +32,6 @@ contract SoulboundProfileNFTTest is Test {
|
||||
vm.prank(user);
|
||||
vm.expectRevert("Profile already exists");
|
||||
soulboundNFT.mintProfile("Alice", 25, "ipfs://profileImage");
|
||||
|
||||
}
|
||||
|
||||
function testTokenURI() public {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user