refactor: remove upgradeTokenBuild and fix burn requirement
This commit is contained in:
parent
752bbb896a
commit
12a7a2cdf9
|
|
@ -84,16 +84,6 @@ contract FleekERC721 is ERC721, FleekAccessControl {
|
||||||
return tokenId;
|
return tokenId;
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgradeTokenBuild(
|
|
||||||
uint256 tokenId,
|
|
||||||
string memory commit,
|
|
||||||
string memory repository,
|
|
||||||
string memory author
|
|
||||||
) public payable requireTokenOwner(tokenId) {
|
|
||||||
_requireMinted(tokenId);
|
|
||||||
setTokenBuild(tokenId, commit, repository, author);
|
|
||||||
}
|
|
||||||
|
|
||||||
function tokenURI(
|
function tokenURI(
|
||||||
uint256 tokenId
|
uint256 tokenId
|
||||||
) public view virtual override returns (string memory) {
|
) public view virtual override returns (string memory) {
|
||||||
|
|
@ -234,11 +224,7 @@ contract FleekERC721 is ERC721, FleekAccessControl {
|
||||||
|
|
||||||
function burn(
|
function burn(
|
||||||
uint256 tokenId
|
uint256 tokenId
|
||||||
) public virtual requireTokenController(tokenId) {
|
) public virtual requireTokenOwner(tokenId) {
|
||||||
require(
|
|
||||||
ownerOf(tokenId) == msg.sender,
|
|
||||||
"FleekERC721: must be token owner"
|
|
||||||
);
|
|
||||||
super._burn(tokenId);
|
super._burn(tokenId);
|
||||||
|
|
||||||
if (bytes(_apps[tokenId].external_url).length != 0) {
|
if (bytes(_apps[tokenId].external_url).length != 0) {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const params = [
|
||||||
contractAddress
|
contractAddress
|
||||||
);
|
);
|
||||||
|
|
||||||
const transaction = await contract.upgradeTokenBuild(...params);
|
const transaction = await contract.setTokenBuild(...params);
|
||||||
|
|
||||||
console.log('Response: ', transaction);
|
console.log('Response: ', transaction);
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue