Fix token owner error
This commit is contained in:
parent
63820f7a87
commit
afb1f1e73b
|
|
@ -67,7 +67,7 @@ contract FleekERC721 is ERC721, FleekAccessControl {
|
||||||
) public payable requireCollectionOwner returns (uint256) {
|
) public payable requireCollectionOwner returns (uint256) {
|
||||||
uint256 tokenId = _tokenIds.current();
|
uint256 tokenId = _tokenIds.current();
|
||||||
_mint(to, tokenId);
|
_mint(to, tokenId);
|
||||||
addTokenController(tokenId, to);
|
_addTokenController(tokenId, to);
|
||||||
_tokenIds.increment();
|
_tokenIds.increment();
|
||||||
|
|
||||||
App storage app = _apps[tokenId];
|
App storage app = _apps[tokenId];
|
||||||
|
|
@ -127,6 +127,14 @@ contract FleekERC721 is ERC721, FleekAccessControl {
|
||||||
_grantRole(_tokenRole(tokenId, "CONTROLLER"), controller);
|
_grantRole(_tokenRole(tokenId, "CONTROLLER"), controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _addTokenController(
|
||||||
|
uint256 tokenId,
|
||||||
|
address controller
|
||||||
|
) internal {
|
||||||
|
_requireMinted(tokenId);
|
||||||
|
_grantRole(_tokenRole(tokenId, "CONTROLLER"), controller);
|
||||||
|
}
|
||||||
|
|
||||||
function removeTokenController(
|
function removeTokenController(
|
||||||
uint256 tokenId,
|
uint256 tokenId,
|
||||||
address controller
|
address controller
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"contracts/FleekERC721.sol": {
|
"contracts/FleekERC721.sol": {
|
||||||
"lastModificationDate": 1670412322054,
|
"lastModificationDate": 1670425560329,
|
||||||
"contentHash": "8e01be0410a9ffbb2857e7215da33704",
|
"contentHash": "9522992e0912fe3d7fb8dbbd44df3550",
|
||||||
"sourceName": "contracts/FleekERC721.sol",
|
"sourceName": "contracts/FleekERC721.sol",
|
||||||
"solcConfig": {
|
"solcConfig": {
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|
@ -1356,8 +1356,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test/foundry/apps.t.sol": {
|
"test/foundry/apps.t.sol": {
|
||||||
"lastModificationDate": 1670421448731,
|
"lastModificationDate": 1670425619647,
|
||||||
"contentHash": "ded5c47848d94e49eb22b8f12b8327ad",
|
"contentHash": "04a0358899f22e7f132b2e88e022426c",
|
||||||
"sourceName": "test/foundry/apps.t.sol",
|
"sourceName": "test/foundry/apps.t.sol",
|
||||||
"solcConfig": {
|
"solcConfig": {
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -9,11 +9,7 @@ contract ContractBTest is Test {
|
||||||
function setUp() public {
|
function setUp() public {
|
||||||
fleekContract = new FleekERC721('Test Contract', 'FLKAPS');
|
fleekContract = new FleekERC721('Test Contract', 'FLKAPS');
|
||||||
}
|
}
|
||||||
|
|
||||||
function testCollectionOwner() public {
|
|
||||||
assertEq(fleekContract.COLLECTION_OWNER_ROLE, keccak256('0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84'));
|
|
||||||
}
|
|
||||||
|
|
||||||
function testName() public {
|
function testName() public {
|
||||||
assertEq(fleekContract.name(), 'Test Contract');
|
assertEq(fleekContract.name(), 'Test Contract');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue