Verified contractExact
PreSale
Address0x058f24aaa844aacb2a3ec99dab1bc30ffe551a6a
- Balance
0 ETH
- Transactions
155
- Compiler
solc 0.6.0
- Same code
Only this contract
Details
- Compiler
- solc 0.6.0+commit.26b70077
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- istanbul
- License
- Not stated
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 11,326,585
- Creation transaction
- 0x270764ab75…b24e9b1197
browser/presale.sol
pragma solidity 0.6.0;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
interface ERC20 {
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint value) external returns (bool success);
}
contract PreSale {
using SafeMath for uint256;
ERC20 private timeToken;
address payable private owner;
constructor(address token) public {
owner = msg.sender;
timeToken = ERC20(token);
}
//Buy tokens
function buyTokensByETH() external payable {
require(msg.value <= 0.01 ether);
uint256 amountOfTokens = msg.value;
amountOfTokens = amountOfTokens.mul(700); //adjust tokens count to eth
owner.transfer(msg.value);
timeToken.transfer(msg.sender, amountOfTokens);
}
// Not sold tokens
function returnNotSoldTokens() public returns (bool success) {
require(msg.sender == owner);
timeToken.transfer(msg.sender, timeToken.balanceOf(address(this)));
return true;
}
// Wrong Send Various Tokens
function returnVariousTokenFromContract(address tokenAddress) public returns (bool success) {
require(msg.sender == owner);
ERC20 tempToken = ERC20(tokenAddress);
tempToken.transfer(msg.sender, tempToken.balanceOf(address(this)));
return true;
}
// Wrong Send ETH
function returnETHFromContract(uint256 value) public returns (bool success) {
require(msg.sender == owner);
msg.sender.transfer(value);
return true;
}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.