Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : DONDIAirdrop
/* * Author : Christopher D. */ pragma solidity 0.5.17; library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } } interface IERC20 { function mint(address account, uint amount) external; } contract DONDIAirdrop { using SafeMath for uint256; mapping(address => uint256) public supplies; IERC20 public dondi = IERC20(0x45Ed25A237B6AB95cE69aF7555CF8D7A2FfEE67c); //need replace address public gov; event Airdropped(address indexed user_, uint256 value_); constructor() public { gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "require gov!"); _; } function setAirdropSupply(address pool, uint256 initSupply) external onlyGov { supplies[pool] = initSupply; } function transferOwnership(address owner) external onlyGov { gov = owner; } function getRemainAirdrop(address pool) external view returns (uint256) { return supplies[pool]; } function airdrop(uint256 value) external { require(supplies[msg.sender] > 0, "Unable to call!"); require(value > 0, "Unable to airdrop 0!"); require(supplies[msg.sender] >= value, "Unable to airdrop!"); dondi.mint(msg.sender, value); supplies[msg.sender] = supplies[msg.sender].sub(value); emit Airdropped(msg.sender, value); } function airdropAll() external { uint256 value = supplies[msg.sender]; require(value > 0, "Unable to call!"); dondi.mint(msg.sender, value); supplies[msg.sender] = 0; emit Airdropped(msg.sender, value); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.