简体   繁体   English

分发团队 NFT(erc721) 代币量

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

I wonder how I can get my teammates to minting without paying Ether.我想知道如何让我的队友在不支付以太币的情况下进行铸造。 (Pay for gas with Ether in the contract wallet.) Can you give me some ideas on how to distribute the team volume? (用合约钱包中的 Ether 支付 gas。)你能给我一些关于如何分配团队体积的想法吗?

  • If you have a list of your teammates, mint while deploying (in the constructor), for each teammate.如果您有队友列表,请在部署时(在构造函数中)为每个队友创建。 Example code:示例代码:
constructor(address[] _teammates)
    for(uint256 i = 0; i < _teammates.length; i++){
        _mint(_teammates[i], i); // mint i'th token to i'th teammate
    }
}
  • Mint enough tokens beforehand, transfer them to teammates anytime you want.预先铸造足够的代币,随时将它们转移给队友。 Example Code:示例代码:
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
    }
}
  • If you don't want to pay for it either, make the contract itself pay for the gas, then you should use a Gas Station Network如果您也不想为此付款,让合同本身支付天然气费用,那么您应该使用加油站网络

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

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