Verified contractPartial
Presale
Address0xff8aaf83d674d9f19bfc00ac5108a72c760fa5ab
- Balance
0 ETH
- Transactions
260
- Compiler
solc 0.5.17
- Same code
Only this contract
Details
- Compiler
- solc 0.5.17+commit.d19bba13
- Language
- solidity
- Optimization
- No
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 9,676,130
- Creation transaction
- 0xe12cce6051…a980847752
Presale.sol
pragma solidity ^0.5.0;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
interface IERC20 {
//function totalSupply() public constant returns (uint256 );
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
//function decimals() public constant returns (uint8 decimals);
//function transferFrom(address _from, address _to, uint256 _value) public returns (bool );
//function approve(address _spender, uint256 _value) public returns (bool );
//function allowance(address _owner, address _spender) public constant returns (uint256 );
//event Transfer(address indexed _from, address indexed _to, uint256 _value);
//event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
interface IERC20X {
function balanceOf(address _owner) external view returns (uint256 );
function transfer(address _to, uint256 _value) external ;
}
contract Presale is Ownable {
function batchTransfer(address[] memory _recipients, uint[] memory _values, address _tokenAddress) onlyOwner public {
require( _recipients.length > 0 && _recipients.length == _values.length);
IERC20 token = IERC20(_tokenAddress);
// uint8 decimals = token.decimals();
// uint total = 0;
// for(uint i = 0; i < _values.length; i++){
// total += _values[i];
// }
// require(total <= token.balanceOf(this));
for(uint j = 0; j < _recipients.length; j++){
require ( token.transfer(_recipients[j], _values[j]) );
}
}
function withdrawalToken(address _tokenAddress) onlyOwner public {
IERC20 token = IERC20(_tokenAddress);
token.transfer(owner, token.balanceOf( address(this) ));
}
// no bool return token
function batch(address[] memory _recipients, uint[] memory _values, address _tokenAddress) onlyOwner public {
require( _recipients.length > 0 && _recipients.length == _values.length);
IERC20X token = IERC20X(_tokenAddress);
for(uint j = 0; j < _recipients.length; j++){
token.transfer(_recipients[j], _values[j] );
}
}
function withdrawal(address _tokenAddress) onlyOwner public {
IERC20X token = IERC20X(_tokenAddress);
token.transfer(owner, token.balanceOf(address(this)));
}
function () external payable {
revert();
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.