繁体   English   中英

分发团队 NFT(erc721) 代币量

[英]distribute the team NFT(erc721)token volume

我想知道如何让我的队友在不支付以太币的情况下进行铸造。 (用合约钱包中的 Ether 支付 gas。)你能给我一些关于如何分配团队体积的想法吗?

  • 如果您有队友列表,请在部署时(在构造函数中)为每个队友创建。 示例代码:
constructor(address[] _teammates)
    for(uint256 i = 0; i < _teammates.length; i++){
        _mint(_teammates[i], i); // mint i'th token to i'th teammate
    }
}
  • 预先铸造足够的代币,随时将它们转移给队友。 示例代码:
constructor(address[] _teammates)
    teammates = _teammates;
}

function distributeTokensToTeam() public onlyOwner{
    for(uint256 i = 0; i < teammates.length; i++){
        transfer(teammates[i], i); // send i'th token to i'th teammate
    }
}
  • 如果您也不想为此付款,让合同本身支付天然气费用,那么您应该使用加油站网络

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM