ETH Price: $3,338.32 (-1.87%)
 
Transaction Hash
Method
Block
From
To
Count Up Deliver...85157492019-09-09 12:46:341941 days ago1568033194IN
Aeternity: Migration Contract
0 ETH0.00135620
Transfer83945732019-08-21 15:57:591960 days ago1566403079IN
Aeternity: Migration Contract
0.00001 ETH0.0001899
Count Up Deliver...77610262019-05-14 21:54:022058 days ago1557870842IN
Aeternity: Migration Contract
0 ETH0.00027124
Count Up Deliver...72253422019-02-15 23:03:442146 days ago1550271824IN
Aeternity: Migration Contract
0 ETH0.00020343
Count Up Deliver...67728022018-11-25 23:16:562228 days ago1543187816IN
Aeternity: Migration Contract
0 ETH0.00040686

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenBurner

Compiler Version
v0.4.25+commit.59dbf8f1

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-11-11
*/

pragma solidity ^0.4.24;

// Fallback ERC20 token definition.
contract tokenFallback {
	uint256 public totalSupply;

	function balanceOf(address _owner) public constant returns (uint256 balance);
	function transfer(address _to, uint256 _value) public returns (bool success);
	function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
	function approve(address _spender, uint256 _value) public returns (bool success);
	function allowance(address _owner, address _spender) public constant returns (uint256 remaining);

	event Transfer(address indexed _from, address indexed _to, uint256 _value);
	event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}

contract TokenBurner {
	struct Claim {
		uint256[] amount;
		string[] pubkey;
	}

	struct BatchTime {
		uint256 blockNumber;
		uint256 eventCount;
	}

	// Keep track of token burn batches - use this number for filtering in the emitted Burn event.
	uint16 public AEdeliveryBatchCounter = 0;

	// The admin who may count up the AE delivery batch count
	address public AEdmin;
	address public AEToken;

	// check if transaction sender is AEdmin.
	modifier onlyAEdmin() {
		require (msg.sender == AEdmin);
		_;
	}

	mapping(address => Claim) burned;
	// count the amount of burns for later filtering of all burnings
	uint256 public burnCount;
	// track amount of burn events for each delivery period e.g. for checking if the event scanner missed something
	mapping(uint16 => BatchTime) public batchTimes;

	constructor(address _AEdmin, address _AEToken) public {
		require (_AEdmin != 0x0);
		AEdmin = _AEdmin;

		if (_AEToken == 0x0) {
			_AEToken = 0x5CA9a71B1d01849C0a95490Cc00559717fCF0D1d; // Mainnet contract
		}

		AEToken = _AEToken;
	}

	// check if address starts with an ak_
	function checkAddress(bytes str) public pure returns (bool) {
		bytes memory ak = "ak_";
		bytes memory result = new bytes(3);
		for(uint i = 0; i < 3; i++) {
			result[i-0] = str[i];
		}
		return (keccak256(result) == keccak256(ak));
	}

	function receiveApproval(
			address _from,
			uint256 _value,
			address _token,
			bytes _pubkey
			) public returns (bool) {

		// Only let people burn AE through original AEToken contract.
		require(msg.sender == AEToken);

		// minimal form of type checking with room for unexpected outcomes of base58 encodings

		// we need to cast _pubKey to string before performing length checks, because sometimes
		// transaction data can have extra zeros at the end, which are cut away when
		// casting string from bytes
		string memory pubKeyString = string(_pubkey);

		require (bytes(pubKeyString).length > 50 && bytes(pubKeyString).length < 70);
		require (checkAddress(_pubkey));

		require(tokenFallback(_token).transferFrom(_from, this, _value));
		burned[_from].pubkey.push(pubKeyString); // pushing pubkey and value, to allow 1 user burn n times to m pubkeys
		burned[_from].amount.push(_value);
		emit Burn(_from, _pubkey, _value, ++burnCount, AEdeliveryBatchCounter);
		return true;
	}

	function countUpDeliveryBatch()
		public onlyAEdmin
		{
			batchTimes[AEdeliveryBatchCounter].blockNumber = block.number;
			batchTimes[AEdeliveryBatchCounter].eventCount = burnCount;
			++AEdeliveryBatchCounter;
		}

	event Burn(address indexed _from, bytes _pubkey, uint256 _value, uint256 _count, uint16 indexed _deliveryPeriod);
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"AEdeliveryBatchCounter","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"burnCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"str","type":"bytes"}],"name":"checkAddress","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"countUpDeliveryBatch","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"},{"name":"_token","type":"address"},{"name":"_pubkey","type":"bytes"}],"name":"receiveApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint16"}],"name":"batchTimes","outputs":[{"name":"blockNumber","type":"uint256"},{"name":"eventCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"AEToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"AEdmin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_AEdmin","type":"address"},{"name":"_AEToken","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":false,"name":"_pubkey","type":"bytes"},{"indexed":false,"name":"_value","type":"uint256"},{"indexed":false,"name":"_count","type":"uint256"},{"indexed":true,"name":"_deliveryPeriod","type":"uint16"}],"name":"Burn","type":"event"}]

60806040526000805461ffff1916905534801561001b57600080fd5b5060405160408061088d833981016040528051602090910151600160a060020a038216151561004957600080fd5b60008054600160a060020a0380851662010000026201000060b060020a031990921691909117909155811615156100915750735ca9a71b1d01849c0a95490cc00559717fcf0d1d5b60018054600160a060020a031916600160a060020a0392909216919091179055506107cc806100c16000396000f30060806040526004361061008d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095b01e78114610092578063524773ce146100be578063530bcbb0146100e557806363c30571146101525780638f4ffcb114610169578063b33c5cf4146101d9578063c83a7e941461020e578063fa0845f31461023f575b600080fd5b34801561009e57600080fd5b506100a7610254565b6040805161ffff9092168252519081900360200190f35b3480156100ca57600080fd5b506100d361025e565b60408051918252519081900360200190f35b3480156100f157600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261013e9436949293602493928401919081908401838280828437509497506102649650505050505050565b604080519115158252519081900360200190f35b34801561015e57600080fd5b50610167610430565b005b34801561017557600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261013e94600160a060020a038135811695602480359660443590931695369560849492019181908401838280828437509497506104919650505050505050565b3480156101e557600080fd5b506101f561ffff600435166106c8565b6040805192835260208301919091528051918290030190f35b34801561021a57600080fd5b506102236106e1565b60408051600160a060020a039092168252519081900360200190f35b34801561024b57600080fd5b506102236106f0565b60005461ffff1681565b60035481565b60408051808201825260038082527f616b5f000000000000000000000000000000000000000000000000000000000060208301528251818152808401909352600092606091849190816020016020820280388339019050509150600090505b600381101561036e5784818151811015156102da57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002826000830381518110151561033657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016102c3565b826040518082805190602001908083835b6020831061039e5780518252601f19909201916020918201910161037f565b51815160209384036101000a6000190180199092169116179052604051919093018190038120875190955087945090928392508401908083835b602083106103f75780518252601f1990920191602091820191016103d8565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209390931498975050505050505050565b600054620100009004600160a060020a0316331461044d57600080fd5b6000805461ffff908116825260046020526040808320439055600354835483168452908320600190810191909155825461ffff198116908316909101909116179055565b600154600090606090600160a060020a031633146104ae57600080fd5b829050603281511180156104c3575060468151105b15156104ce57600080fd5b6104d783610264565b15156104e257600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038881166004830152306024830152604482018890529151918616916323b872dd916064808201926020929091908290030181600087803b15801561055457600080fd5b505af1158015610568573d6000803e3d6000fd5b505050506040513d602081101561057e57600080fd5b5051151561058b57600080fd5b600160a060020a03861660009081526002602090815260408220600190810180549182018082559084529282902084516105cd93919092019190850190610705565b5050600160a060020a0386166000818152600260209081526040808320805460018181018355918552838520018a90558354600380549092019182905582518085018c90529283018290526060808452895190840152885161ffff90911695947f750a9579a45dea376a35c93ce214a7a9a46af18fb438069f8f734ab75891afb0948a948d9493909283926080840192908801918190849084905b83811015610680578181015183820152602001610668565b50505050905090810190601f1680156106ad5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a350600195945050505050565b6004602052600090815260409020805460019091015482565b600154600160a060020a031681565b600054620100009004600160a060020a031681565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061074657805160ff1916838001178555610773565b82800160010185558215610773579182015b82811115610773578251825591602001919060010190610758565b5061077f929150610783565b5090565b61079d91905b8082111561077f5760008155600101610789565b905600a165627a7a72305820f8d5aecce6dbc1818575b48d3973735787c33b16841468a3eeb3a352c286a5f40029000000000000000000000000eb31d878b60bac00f5a8888fe6ca43abe546c7e80000000000000000000000005ca9a71b1d01849c0a95490cc00559717fcf0d1d

Deployed Bytecode

0x60806040526004361061008d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095b01e78114610092578063524773ce146100be578063530bcbb0146100e557806363c30571146101525780638f4ffcb114610169578063b33c5cf4146101d9578063c83a7e941461020e578063fa0845f31461023f575b600080fd5b34801561009e57600080fd5b506100a7610254565b6040805161ffff9092168252519081900360200190f35b3480156100ca57600080fd5b506100d361025e565b60408051918252519081900360200190f35b3480156100f157600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261013e9436949293602493928401919081908401838280828437509497506102649650505050505050565b604080519115158252519081900360200190f35b34801561015e57600080fd5b50610167610430565b005b34801561017557600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261013e94600160a060020a038135811695602480359660443590931695369560849492019181908401838280828437509497506104919650505050505050565b3480156101e557600080fd5b506101f561ffff600435166106c8565b6040805192835260208301919091528051918290030190f35b34801561021a57600080fd5b506102236106e1565b60408051600160a060020a039092168252519081900360200190f35b34801561024b57600080fd5b506102236106f0565b60005461ffff1681565b60035481565b60408051808201825260038082527f616b5f000000000000000000000000000000000000000000000000000000000060208301528251818152808401909352600092606091849190816020016020820280388339019050509150600090505b600381101561036e5784818151811015156102da57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002826000830381518110151561033657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506001016102c3565b826040518082805190602001908083835b6020831061039e5780518252601f19909201916020918201910161037f565b51815160209384036101000a6000190180199092169116179052604051919093018190038120875190955087945090928392508401908083835b602083106103f75780518252601f1990920191602091820191016103d8565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209390931498975050505050505050565b600054620100009004600160a060020a0316331461044d57600080fd5b6000805461ffff908116825260046020526040808320439055600354835483168452908320600190810191909155825461ffff198116908316909101909116179055565b600154600090606090600160a060020a031633146104ae57600080fd5b829050603281511180156104c3575060468151105b15156104ce57600080fd5b6104d783610264565b15156104e257600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038881166004830152306024830152604482018890529151918616916323b872dd916064808201926020929091908290030181600087803b15801561055457600080fd5b505af1158015610568573d6000803e3d6000fd5b505050506040513d602081101561057e57600080fd5b5051151561058b57600080fd5b600160a060020a03861660009081526002602090815260408220600190810180549182018082559084529282902084516105cd93919092019190850190610705565b5050600160a060020a0386166000818152600260209081526040808320805460018181018355918552838520018a90558354600380549092019182905582518085018c90529283018290526060808452895190840152885161ffff90911695947f750a9579a45dea376a35c93ce214a7a9a46af18fb438069f8f734ab75891afb0948a948d9493909283926080840192908801918190849084905b83811015610680578181015183820152602001610668565b50505050905090810190601f1680156106ad5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a350600195945050505050565b6004602052600090815260409020805460019091015482565b600154600160a060020a031681565b600054620100009004600160a060020a031681565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061074657805160ff1916838001178555610773565b82800160010185558215610773579182015b82811115610773578251825591602001919060010190610758565b5061077f929150610783565b5090565b61079d91905b8082111561077f5760008155600101610789565b905600a165627a7a72305820f8d5aecce6dbc1818575b48d3973735787c33b16841468a3eeb3a352c286a5f40029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000eb31d878b60bac00f5a8888fe6ca43abe546c7e80000000000000000000000005ca9a71b1d01849c0a95490cc00559717fcf0d1d

-----Decoded View---------------
Arg [0] : _AEdmin (address): 0xEb31D878B60BAC00F5a8888fE6CA43ABE546c7E8
Arg [1] : _AEToken (address): 0x5CA9a71B1d01849C0a95490Cc00559717fCF0D1d

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000eb31d878b60bac00f5a8888fe6ca43abe546c7e8
Arg [1] : 0000000000000000000000005ca9a71b1d01849c0a95490cc00559717fcf0d1d


Swarm Source

bzzr://f8d5aecce6dbc1818575b48d3973735787c33b16841468a3eeb3a352c286a5f4

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.