Home > OS >  distribute the team NFT(erc721)token volume
distribute the team NFT(erc721)token volume

Time:04-06

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?

CodePudding user response:

  • 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
  • Related