hi. i want to transfer a fixed amount of a trc10 token to a list of wallets. is there any way? i found a section called "TRC-10 Transfer in Smart Contracts" in tron developpers network. is this code applicable? thanks
Jun 21, 2021, 4:38 PM
You can do it manually to each wallet, or write up an airdrop contract and use it.
Jun 21, 2021, 5:12 PM
Do you have an example of airdrop contract?
Jun 21, 2021, 9:05 PM
If you google it, you should find a bunch of examples you can fork online
Jun 21, 2021, 9:41 PM
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Airdrop is Ownable {
function drop(IERC20 token, address[] memory recipients) public onlyOwner {
for (uint256 i = 0; i < recipients.length; i++) {
token.transfer(recipients[i], 1000000000000000000);
}
}
}
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Airdrop is Ownable {
function drop(IERC20 token, address[] memory recipients) public onlyOwner {
for (uint256 i = 0; i < recipients.length; i++) {
token.transfer(recipients[i], 1000000000000000000);
}
}
}
This send 1 token with 18 decimals to an array of addresses, change the 1000000000000000000 to your desired amount
Jun 21, 2021, 10:58 PM