This commit is contained in:
parent
5b65dfcc38
commit
878bd34ef6
@ -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");
|
||||||
|
|||||||
@ -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,
|
||||||
|
'"}'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user