Web3: Token/Contrato Solidity com funçāo Airdrop Multi-mint simples
Autor: Anderson Carlos Campolina
Linkedin: https://www.linkedin.com/in/anderson-campolina-688175225/
Airdrop: https://polygonscan.com/tx/0x08f33a8326b11eaba6bf257438b3c4aff8ef8264055e4edbbb380a8f8793bf8f
Contrato: https://polygonscan.com/token/0x88c95bb44509e478f5831b02350f7ade68223ee9#writeContract
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
/// @custom:security-contact [email protected]
contract AirdropToken is ERC20, Ownable {
constructor() ERC20("AirdropToken", "ADT") {}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
function airdropMint(address[] memory addrArr, uint256[] memory amountArr) public onlyOwner {
for (uint256 i = 0;i < addrArr.length; i++) {
_mint(addrArr[i], amountArr[i] * 10 ** decimals());
}
}
}