{
address: "0x76c2315b2e96876d0d3db8f036f74fee3b581785",
balance: {
type: "BigNumber",
hex: "0x00"
string: "0"
ether: "0.0"
},
"transactions": [],
code: "/*
Name: Presale Token
Version: 0.0.3
*/
class Ownable {
owner = '0x0000000000000000000000000000000000000000';
OwnershipTransferred(oldOwner, newOwner) {} // event
constructor() {
this.owner = msg.sender;
}
getOwner() {
return [this.owner];
}
transferOwnership(newOwner) {
require(newOwner != address(0), "Ownable: new owner is the zero address");
this._transferOwnership(newOwner);
}
_transferOwnership(newOwner) {
newOwner = newOwner.toLowerCase();
const oldOwner = this.owner;
this.owner = newOwner;
emit('OwnershipTransferred', [oldOwner, newOwner]);
}
_onlyOwner(next) {
require(msg.sender.toLowerCase() == this.owner, 'only owner can execute this');
next();
}
}
// Methods
Ownable.prototype.OwnershipTransferred.event = true;
Ownable.prototype.OwnershipTransferred.inputs = ['address indexed', 'address indexed'];
// Methods
Ownable.prototype.getOwner.view = true;
Ownable.prototype.getOwner.outputs = ['address'];
Ownable.prototype.transferOwnership.inputs = ['address'];
Ownable.prototype.transferOwnership.modifiers = ['_onlyOwner'];
Ownable.prototype._transferOwnership.internal = true;
Ownable.prototype._onlyOwner.internal = true;
class ERC20Token extends Ownable {
name = 'ERC20 Token';
symbol = 'ERC20';
decimals = 18;
totalSupply = number('0');
allowed = {};
balances = {};
supportedInterfaces = {
'0x36372b07': true, // ERC20
'0x06fdde03': true, // ERC20 name
'0x95d89b41': true, // ERC20 symbol
'0x313ce567': true, // ERC20 decimals
};
Transfer(sender, recipient, amount) {} // event
Approval(owner, spender, amount) {} // event
Mint(minter, amount) {} // event
Burn(burner, amount) {} // event
balanceOf(holderAddress) {
holderAddress = holderAddress.toLowerCase();
var tokenBalances = this.balances || {};
if (holderAddress in tokenBalances) {
const balance = tokenBalances[holderAddress];
return [balance];
}
return [number(0)];
}
transfer(recipient, amount) {
recipient = recipient.toLowerCase();
const sender = msg.sender;
var tokenBalances = this.balances || {};
if (! (sender in tokenBalances)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
if (tokenBalances[sender].lt(amount)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
if (this._decrementUserBalance.bind(this)(sender, amount)) {
this._incrementUserBalance.bind(this)(recipient, amount)
}
emit('Transfer', [sender, recipient, amount]);
return [true];
}
transferFrom(sender, recipient, amount) {
sender = sender.toLowerCase();
recipient = recipient.toLowerCase();
var tokenBalances = this.balances || {};
var tokenAllowances = this.allowed || {};
require(sender in tokenBalances, 'MISSING_TOKEN_BALANCE');
if (tokenBalances[sender].lt(amount)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
require(sender == msg.sender || (sender in tokenAllowances && msg.sender in tokenAllowances[sender]), "MISSING_ALLOWANCE");
if (sender != msg.sender && tokenAllowances[sender][msg.sender].lt(amount)) {
_throw('INSUFFICIENT_TOKEN_ALLOWANCE');
}
tokenAllowances[sender][msg.sender] = tokenAllowances[sender][msg.sender].sub(amount);
if (this._decrementUserBalance.bind(this)(sender, amount)) {
this._incrementUserBalance.bind(this)(recipient, amount)
}
emit('Transfer', [sender, recipient, amount]);
return [true];
}
allowance(owner, spender) {
owner = owner.toLowerCase();
spender = spender.toLowerCase();
var tokenAllowances = this.allowed || {};
if (owner in tokenAllowances && spender in tokenAllowances[owner]) {
return [tokenAllowances[owner][spender]];
}
return [number(0)];
}
approve(spender, value) {
spender = spender.toLowerCase();
var tokenAllowances = this.allowed || {};
if (! (msg.sender in tokenAllowances)) {
tokenAllowances[msg.sender] = {};
}
tokenAllowances[msg.sender][spender] = value;
emit('Approval', [msg.sender, spender, value]);
return [true];
}
mint(userAddress, amount) {
this._mint(userAddress, amount);
}
_mint(userAddress, amount) {
userAddress = userAddress.toLowerCase();
if (userAddress == address(0).address) {
_throw('ERC20: mint to the zero address');
}
if (this._incrementUserBalance.bind(this)(userAddress, amount)) {
this.totalSupply = this.totalSupply.add(amount);
}
emit('Mint', [userAddress, amount]);
}
burn(userAddress, amount) {
this._burn(userAddress, amount);
}
_burn(userAddress, amount) {
userAddress = userAddress.toLowerCase();
if (userAddress == address(0).address) {
_throw('ERC20: burn from the zero address');
}
if (this._decrementUserBalance.bind(this)(userAddress, amount)) {
this.totalSupply = this.totalSupply.sub(amount);
}
emit('Burn', [userAddress, amount]);
}
supportsInterface(interfaceID) {
const _interfaces = this.supportedInterfaces || {};
return [
((interfaceID in _interfaces)
? _interfaces[interfaceID]
: false)
];
}
_decrementUserBalance(holderAddress, amount) {
var tokenBalances = this.balances || {};
if (! (holderAddress in tokenBalances)) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
if (amount.gt(tokenBalances[holderAddress])) {
_throw('INSUFFICIENT_TOKEN_BALANCE');
}
tokenBalances[holderAddress] = tokenBalances[holderAddress].sub(amount);
return true;
}
_incrementUserBalance(holderAddress, amount) {
var tokenBalances = this.balances || {};
if (! (holderAddress in tokenBalances)) {
tokenBalances[holderAddress] = number(0);
}
tokenBalances[holderAddress] = tokenBalances[holderAddress].add(amount);
return true;
}
}
// Events
ERC20Token.prototype.Transfer.event = true;
ERC20Token.prototype.Transfer.inputs = ['address indexed', 'address indexed', 'uint256'];
ERC20Token.prototype.Approval.event = true;
ERC20Token.prototype.Approval.inputs = ['address indexed', 'address indexed', 'uint256'];
ERC20Token.prototype.Mint.event = true;
ERC20Token.prototype.Mint.inputs = ['address indexed', 'uint256'];
ERC20Token.prototype.Burn.event = true;
ERC20Token.prototype.Burn.inputs = ['address indexed', 'uint256'];
// Methods
ERC20Token.prototype.balanceOf.view = true;
ERC20Token.prototype.balanceOf.inputs = ['address'];
ERC20Token.prototype.balanceOf.outputs = ['uint256'];
ERC20Token.prototype.transfer.inputs = ['address', 'uint256'];
ERC20Token.prototype.transfer.outputs = ['bool'];
ERC20Token.prototype.transferFrom.inputs = ['address', 'address', 'uint256'];
ERC20Token.prototype.transferFrom.outputs = ['bool'];
ERC20Token.prototype.allowance.view = true;
ERC20Token.prototype.allowance.inputs = ['address', 'address'];
ERC20Token.prototype.allowance.outputs = ['uint256'];
ERC20Token.prototype.approve.inputs = ['address', 'uint256'];
ERC20Token.prototype.approve.outputs = ['bool'];
ERC20Token.prototype.mint.inputs = ['address', 'uint256'];
ERC20Token.prototype.mint.modifiers = ['_onlyOwner'];
ERC20Token.prototype._mint.internal = true;
ERC20Token.prototype.burn.inputs = ['address', 'uint256'];
ERC20Token.prototype.burn.modifiers = ['_onlyOwner'];
ERC20Token.prototype._burn.internal = true;
ERC20Token.prototype.supportsInterface.view = true;
ERC20Token.prototype.supportsInterface.inputs = ['bytes4'];
ERC20Token.prototype.supportsInterface.outputs = ['bool'];
ERC20Token.prototype._decrementUserBalance.internal = true;
ERC20Token.prototype._incrementUserBalance.internal = true;
class PresaleToken extends ERC20Token {
name = 'Presale Token';
symbol = 'PRE';
saleServiceAddress = '';
Initialize(saleServiceAddress) {} // event
initialize(saleServiceAddress) {
this.saleServiceAddress = saleServiceAddress.toLowerCase();
emit('Initialize', [saleServiceAddress]);
}
mint(recipient, amountToMint) {
require(this.saleServiceAddress != '', "NOT_INITIALIZED");
require(msg.sender == this.saleServiceAddress, "ONLY_STACKING_SERVICE");
this._mint(recipient, amountToMint);
}
}
// Events
PresaleToken.prototype.Initialize.event = true;
PresaleToken.prototype.Initialize.inputs = ['address indexed'];
// Methods
PresaleToken.prototype.initialize.inputs = ['address'];
PresaleToken.prototype.mint.inputs = ['address', 'uint256'];
return PresaleToken;
",
codeHash: "0x98de11557ff983cdaec1fea066cd6c41c4b29974ade37d74ef5ae8733092e422",
codeAbi: {
0x8da5cb5b: {
constant: true,
"inputs": [],
name: "owner",
outputs: [
{
name: "",
type: "address"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x06fdde03: {
constant: true,
"inputs": [],
name: "name",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x95d89b41: {
constant: true,
"inputs": [],
name: "symbol",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x313ce567: {
constant: true,
"inputs": [],
name: "decimals",
outputs: [
{
name: "",
type: "uint256"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x18160ddd: {
constant: true,
"inputs": [],
name: "totalSupply",
outputs: [
{
name: "",
type: "uint256"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x19e1fca4: {
constant: true,
"inputs": [],
name: "allowed",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x7bb98a68: {
constant: true,
"inputs": [],
name: "balances",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x037cc0e6: {
constant: true,
"inputs": [],
name: "supportedInterfaces",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0xb1acb1e4: {
constant: true,
"inputs": [],
name: "saleServiceAddress",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0xa8ac9b50: {
constant: true,
"inputs": [],
name: "prototype",
outputs: [
{
name: "",
type: "string"
}
],
payable: false,
stateMutability: "view",
type: "function"
},
0x36b14535: {
inputs: [
{
name: "saleServiceAddress",
type: "address",
indexed: true
}
],
name: "Initialize",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0xc4d66de8: {
inputs: [
{
name: "saleServiceAddress",
type: "address"
}
],
name: "initialize",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
},
0xddf252ad: {
inputs: [
{
name: "sender",
type: "address",
indexed: true
},
{
name: "recipient",
type: "address",
indexed: true
},
{
name: "amount",
type: "uint256",
indexed: false
}
],
name: "Transfer",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x8c5be1e5: {
inputs: [
{
name: "owner",
type: "address",
indexed: true
},
{
name: "spender",
type: "address",
indexed: true
},
{
name: "amount",
type: "uint256",
indexed: false
}
],
name: "Approval",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x0f6798a5: {
inputs: [
{
name: "minter",
type: "address",
indexed: true
},
{
name: "amount",
type: "uint256",
indexed: false
}
],
name: "Mint",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0xcc16f5db: {
inputs: [
{
name: "burner",
type: "address",
indexed: true
},
{
name: "amount",
type: "uint256",
indexed: false
}
],
name: "Burn",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x70a08231: {
inputs: [
{
name: "holderAddress",
type: "address"
}
],
name: "balanceOf",
outputs: [
{
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
0xa9059cbb: {
inputs: [
{
name: "recipient",
type: "address"
},
{
name: "amount",
type: "uint256"
}
],
name: "transfer",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x23b872dd: {
inputs: [
{
name: "sender",
type: "address"
},
{
name: "recipient",
type: "address"
},
{
name: "amount",
type: "uint256"
}
],
name: "transferFrom",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "nonpayable",
type: "function"
},
0xdd62ed3e: {
inputs: [
{
name: "owner",
type: "address"
},
{
name: "spender",
type: "address"
}
],
name: "allowance",
outputs: [
{
name: "",
type: "uint256"
}
],
stateMutability: "view",
type: "function"
},
0x095ea7b3: {
inputs: [
{
name: "spender",
type: "address"
},
{
name: "value",
type: "uint256"
}
],
name: "approve",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "nonpayable",
type: "function"
},
0x40c10f19: {
inputs: [
{
name: "recipient",
type: "address"
},
{
name: "amountToMint",
type: "uint256"
}
],
name: "mint",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
},
0x9dc29fac: {
inputs: [
{
name: "userAddress",
type: "address"
},
{
name: "amount",
type: "uint256"
}
],
name: "burn",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
},
0x01ffc9a7: {
inputs: [
{
name: "interfaceID",
type: "bytes4"
}
],
name: "supportsInterface",
outputs: [
{
name: "",
type: "bool"
}
],
stateMutability: "view",
type: "function"
},
0x8be0079c: {
inputs: [
{
name: "oldOwner",
type: "address",
indexed: true
},
{
name: "newOwner",
type: "address",
indexed: true
}
],
name: "OwnershipTransferred",
"outputs": [],
stateMutability: "nonpayable",
type: "event"
},
0x893d20e8: {
"inputs": [],
name: "getOwner",
outputs: [
{
name: "",
type: "address"
}
],
stateMutability: "view",
type: "function"
},
0xf2fde38b: {
inputs: [
{
name: "newOwner",
type: "address"
}
],
name: "transferOwnership",
"outputs": [],
stateMutability: "nonpayable",
type: "function"
}
},
contractName: "PresaleToken",
storage: {
prototype: {
address: "0x76c2315b2e96876d0d3db8f036f74fee3b581785"
},
owner: "0x131a190fa22cb867abf58193bf9e7640e9fce682",
name: "Presale Token",
symbol: "PRE",
decimals: 18,
totalSupply: {
type: "BigNumber",
hex: "0x00"
string: "0"
ether: "0.0"
},
"allowed": {},
"balances": {},
supportedInterfaces: {
0x36372b07: true,
0x06fdde03: true,
0x95d89b41: true,
0x313ce567: true
},
saleServiceAddress: "0x0c3b429fa6cd44a96fcea3cc3fc085d1ddee8158"
},
storageHash: "0x6f9425544d8b66c2e06e1959a80b6781118fad1ca184b4374131021c1a18620f",
savedOnBlockNumber: {
type: "BigNumber",
hex: "0x0e"
string: "14"
ether: "0.000000000000000014"
}
}