如何保持事务用户发送和所有者接受事务?
NFT将在游戏中铸币(ERC 721)。我还必须允许用户使用mint,但是由于每个人都可以在游戏之外创建,所以所有者需要在造币前检查URI和值。
如果造币厂的所有者有问题,可以取消交易。
发布于 2022-03-15 13:35:47
您可以添加一个薄荷请求函数来存储薄荷请求,并为合同所有者添加一个审批薄荷请求,这样所有者就可以批准或拒绝薄荷请求。
会是这样的:
function requestMint(/*params to take into consideration*/) external {
mintRequests.push(/*this request param*/);
}
//The owner will use this to see the mint request pile so far
function checkMintRequest() view onlyOwner returns(/*How you decided to store it*/){
return mintRequests;
}
function requestMint(uint id) external onlyOwner{
MintRequest accepted = mintRequests[id];//Im thinking this could be a struct
mint(accepted.account, accepted.tokenId);
}https://ethereum.stackexchange.com/questions/123828
复制相似问题