Feature Tip: Add private address tag to any address under My Name Tag !
Source Code
More Info
Private Name Tags
ContractCreator
Funded By
Latest 25 from a total of 3,515 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Destroy | 7253148 | 2558 days ago | IN | 0 ETH | 0.00013486 | ||||
| Set Price | 7252454 | 2558 days ago | IN | 0 ETH | 0.00039415 | ||||
| Set Price | 7252290 | 2558 days ago | IN | 0 ETH | 0.00030319 | ||||
| Set Price | 7252106 | 2558 days ago | IN | 0 ETH | 0.0002668 | ||||
| Set Price | 7251931 | 2558 days ago | IN | 0 ETH | 0.0002668 | ||||
| Set Price | 7251735 | 2558 days ago | IN | 0 ETH | 0.00018191 | ||||
| Set Price | 7251558 | 2558 days ago | IN | 0 ETH | 0.00018191 | ||||
| Set Price | 7251401 | 2558 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7251209 | 2559 days ago | IN | 0 ETH | 0.00016069 | ||||
| Set Price | 7251042 | 2559 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7250859 | 2559 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7250676 | 2559 days ago | IN | 0 ETH | 0.00016675 | ||||
| Set Price | 7250521 | 2559 days ago | IN | 0 ETH | 0.00016069 | ||||
| Set Price | 7250352 | 2559 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7250152 | 2559 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7249961 | 2559 days ago | IN | 0 ETH | 0.00018191 | ||||
| Set Price | 7249792 | 2559 days ago | IN | 0 ETH | 0.00018191 | ||||
| Set Price | 7249610 | 2559 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7249412 | 2559 days ago | IN | 0 ETH | 0.00015159 | ||||
| Set Price | 7249241 | 2559 days ago | IN | 0 ETH | 0.00042447 | ||||
| Set Price | 7249088 | 2559 days ago | IN | 0 ETH | 0.00018149 | ||||
| Set Price | 7248902 | 2559 days ago | IN | 0 ETH | 0.00024255 | ||||
| Set Price | 7248729 | 2559 days ago | IN | 0 ETH | 0.00024255 | ||||
| Set Price | 7248553 | 2559 days ago | IN | 0 ETH | 0.00040021 | ||||
| Set Price | 7248372 | 2559 days ago | IN | 0 ETH | 0.00039415 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| - | 7253148 | 2558 days ago | 0 ETH | ||||
| - | 7227183 | 2564 days ago | 88.53042821 ETH | ||||
| - | 7182293 | 2574 days ago | 0.51769607 ETH | ||||
| - | 7182293 | 2574 days ago | 0.00788369 ETH | ||||
| - | 7107713 | 2589 days ago | 3.83118856 ETH | ||||
| - | 7107713 | 2589 days ago | 0.05834297 ETH | ||||
| - | 6998669 | 2609 days ago | 0.17499877 ETH | ||||
| - | 6998669 | 2609 days ago | 0.00266495 ETH | ||||
| - | 6947401 | 2618 days ago | 0.72433859 ETH | ||||
| - | 6947401 | 2618 days ago | 0.01103053 ETH | ||||
| - | 6908832 | 2624 days ago | 0.95897004 ETH | ||||
| - | 6908832 | 2624 days ago | 0.0146036 ETH | ||||
| - | 6890605 | 2627 days ago | 5.09020362 ETH | ||||
| - | 6890605 | 2627 days ago | 0.07751579 ETH | ||||
| - | 6842869 | 2635 days ago | 17.58887977 ETH | ||||
| - | 6842869 | 2635 days ago | 0.26785096 ETH | ||||
| - | 6842329 | 2635 days ago | 0.31110419 ETH | ||||
| - | 6842329 | 2635 days ago | 0.00473762 ETH | ||||
| - | 6842122 | 2635 days ago | 3.04904617 ETH | ||||
| - | 6842122 | 2635 days ago | 0.04643217 ETH | ||||
| Transfer | 6770493 | 2647 days ago | 0.16369837 ETH | ||||
| Transfer | 6770493 | 2647 days ago | 0.00249286 ETH | ||||
| Transfer | 6767975 | 2647 days ago | 3.73491241 ETH | ||||
| Transfer | 6767975 | 2647 days ago | 0.05687683 ETH | ||||
| Transfer | 6723659 | 2655 days ago | 0.42371804 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Self Destruct called at Txn Hash 0xa131a62fee63effc6d02fe170ee15a01d086fb118cb17156f3e07de2da3da71c
Contract Name:
ATxBuyback
Compiler Version
v0.4.19+commit.c4cbbb05
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-10-01
*/
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/// @title ServiceAllowance.
///
/// Provides a way to delegate operation allowance decision to a service contract
contract ServiceAllowance {
function isTransferAllowed(address _from, address _to, address _sender, address _token, uint _value) public view returns (bool);
}
contract ATxPlatformInterface {
mapping(bytes32 => address) public proxies;
function name(bytes32 _symbol) public view returns (string);
function setProxy(address _address, bytes32 _symbol) public returns (uint errorCode);
function isOwner(address _owner, bytes32 _symbol) public view returns (bool);
function totalSupply(bytes32 _symbol) public view returns (uint);
function balanceOf(address _holder, bytes32 _symbol) public view returns (uint);
function allowance(address _from, address _spender, bytes32 _symbol) public view returns (uint);
function baseUnit(bytes32 _symbol) public view returns (uint8);
function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference, address _sender) public returns (uint errorCode);
function proxyTransferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference, address _sender) public returns (uint errorCode);
function proxyApprove(address _spender, uint _value, bytes32 _symbol, address _sender) public returns (uint errorCode);
function issueAsset(bytes32 _symbol, uint _value, string _name, string _description, uint8 _baseUnit, bool _isReissuable) public returns (uint errorCode);
function reissueAsset(bytes32 _symbol, uint _value) public returns (uint errorCode);
function revokeAsset(bytes32 _symbol, uint _value) public returns (uint errorCode);
function isReissuable(bytes32 _symbol) public view returns (bool);
function changeOwnership(bytes32 _symbol, address _newOwner) public returns (uint errorCode);
}
/**
* @title Owned contract with safe ownership pass.
*
* Note: all the non constant functions return false instead of throwing in case if state change
* didn't happen yet.
*/
contract Owned {
/**
* Contract owner address
*/
address public contractOwner;
/**
* Contract owner address
*/
address public pendingContractOwner;
function Owned() {
contractOwner = msg.sender;
}
/**
* @dev Owner check modifier
*/
modifier onlyContractOwner() {
if (contractOwner == msg.sender) {
_;
}
}
/**
* @dev Destroy contract and scrub a data
* @notice Only owner can call it
*/
function destroy() onlyContractOwner {
suicide(msg.sender);
}
/**
* Prepares ownership pass.
*
* Can only be called by current owner.
*
* @param _to address of the next owner. 0x0 is not allowed.
*
* @return success.
*/
function changeContractOwnership(address _to) onlyContractOwner() returns(bool) {
if (_to == 0x0) {
return false;
}
pendingContractOwner = _to;
return true;
}
/**
* Finalize ownership pass.
*
* Can only be called by pending owner.
*
* @return success.
*/
function claimContractOwnership() returns(bool) {
if (pendingContractOwner != msg.sender) {
return false;
}
contractOwner = pendingContractOwner;
delete pendingContractOwner;
return true;
}
}
contract ERC20Interface {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed from, address indexed spender, uint256 value);
string public symbol;
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
}
/**
* @title Generic owned destroyable contract
*/
contract Object is Owned {
/**
* Common result code. Means everything is fine.
*/
uint constant OK = 1;
uint constant OWNED_ACCESS_DENIED_ONLY_CONTRACT_OWNER = 8;
function withdrawnTokens(address[] tokens, address _to) onlyContractOwner returns(uint) {
for(uint i=0;i<tokens.length;i++) {
address token = tokens[i];
uint balance = ERC20Interface(token).balanceOf(this);
if(balance != 0)
ERC20Interface(token).transfer(_to,balance);
}
return OK;
}
function checkOnlyContractOwner() internal constant returns(uint) {
if (contractOwner == msg.sender) {
return OK;
}
return OWNED_ACCESS_DENIED_ONLY_CONTRACT_OWNER;
}
}
/// @title Provides possibility manage holders? country limits and limits for holders.
contract DataControllerInterface {
/// @notice Checks user is holder.
/// @param _address - checking address.
/// @return `true` if _address is registered holder, `false` otherwise.
function isHolderAddress(address _address) public view returns (bool);
function allowance(address _user) public view returns (uint);
function changeAllowance(address _holder, uint _value) public returns (uint);
}
/// @title ServiceController
///
/// Base implementation
/// Serves for managing service instances
contract ServiceControllerInterface {
/// @notice Check target address is service
/// @param _address target address
/// @return `true` when an address is a service, `false` otherwise
function isService(address _address) public view returns (bool);
}
contract ATxAssetInterface {
DataControllerInterface public dataController;
ServiceControllerInterface public serviceController;
function __transferWithReference(address _to, uint _value, string _reference, address _sender) public returns (bool);
function __transferFromWithReference(address _from, address _to, uint _value, string _reference, address _sender) public returns (bool);
function __approve(address _spender, uint _value, address _sender) public returns (bool);
function __process(bytes /*_data*/, address /*_sender*/) payable public {
revert();
}
}
contract ERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed from, address indexed spender, uint256 value);
string public symbol;
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
}
contract Platform {
mapping(bytes32 => address) public proxies;
function name(bytes32 _symbol) public view returns (string);
function setProxy(address _address, bytes32 _symbol) public returns (uint errorCode);
function isOwner(address _owner, bytes32 _symbol) public view returns (bool);
function totalSupply(bytes32 _symbol) public view returns (uint);
function balanceOf(address _holder, bytes32 _symbol) public view returns (uint);
function allowance(address _from, address _spender, bytes32 _symbol) public view returns (uint);
function baseUnit(bytes32 _symbol) public view returns (uint8);
function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference, address _sender) public returns (uint errorCode);
function proxyTransferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference, address _sender) public returns (uint errorCode);
function proxyApprove(address _spender, uint _value, bytes32 _symbol, address _sender) public returns (uint errorCode);
function issueAsset(bytes32 _symbol, uint _value, string _name, string _description, uint8 _baseUnit, bool _isReissuable) public returns (uint errorCode);
function reissueAsset(bytes32 _symbol, uint _value) public returns (uint errorCode);
function revokeAsset(bytes32 _symbol, uint _value) public returns (uint errorCode);
function isReissuable(bytes32 _symbol) public view returns (bool);
function changeOwnership(bytes32 _symbol, address _newOwner) public returns (uint errorCode);
}
contract ATxAssetProxy is ERC20, Object, ServiceAllowance {
using SafeMath for uint;
/**
* Indicates an upgrade freeze-time start, and the next asset implementation contract.
*/
event UpgradeProposal(address newVersion);
// Current asset implementation contract address.
address latestVersion;
// Assigned platform, immutable.
Platform public platform;
// Assigned symbol, immutable.
bytes32 public smbl;
// Assigned name, immutable.
string public name;
/**
* Only platform is allowed to call.
*/
modifier onlyPlatform() {
if (msg.sender == address(platform)) {
_;
}
}
/**
* Only current asset owner is allowed to call.
*/
modifier onlyAssetOwner() {
if (platform.isOwner(msg.sender, smbl)) {
_;
}
}
/**
* Only asset implementation contract assigned to sender is allowed to call.
*/
modifier onlyAccess(address _sender) {
if (getLatestVersion() == msg.sender) {
_;
}
}
/**
* Resolves asset implementation contract for the caller and forwards there transaction data,
* along with the value. This allows for proxy interface growth.
*/
function() public payable {
_getAsset().__process.value(msg.value)(msg.data, msg.sender);
}
/**
* Sets platform address, assigns symbol and name.
*
* Can be set only once.
*
* @param _platform platform contract address.
* @param _symbol assigned symbol.
* @param _name assigned name.
*
* @return success.
*/
function init(Platform _platform, string _symbol, string _name) public returns (bool) {
if (address(platform) != 0x0) {
return false;
}
platform = _platform;
symbol = _symbol;
smbl = stringToBytes32(_symbol);
name = _name;
return true;
}
/**
* Returns asset total supply.
*
* @return asset total supply.
*/
function totalSupply() public view returns (uint) {
return platform.totalSupply(smbl);
}
/**
* Returns asset balance for a particular holder.
*
* @param _owner holder address.
*
* @return holder balance.
*/
function balanceOf(address _owner) public view returns (uint) {
return platform.balanceOf(_owner, smbl);
}
/**
* Returns asset allowance from one holder to another.
*
* @param _from holder that allowed spending.
* @param _spender holder that is allowed to spend.
*
* @return holder to spender allowance.
*/
function allowance(address _from, address _spender) public view returns (uint) {
return platform.allowance(_from, _spender, smbl);
}
/**
* Returns asset decimals.
*
* @return asset decimals.
*/
function decimals() public view returns (uint8) {
return platform.baseUnit(smbl);
}
/**
* Transfers asset balance from the caller to specified receiver.
*
* @param _to holder address to give to.
* @param _value amount to transfer.
*
* @return success.
*/
function transfer(address _to, uint _value) public returns (bool) {
if (_to != 0x0) {
return _transferWithReference(_to, _value, "");
}
else {
return false;
}
}
/**
* Transfers asset balance from the caller to specified receiver adding specified comment.
*
* @param _to holder address to give to.
* @param _value amount to transfer.
* @param _reference transfer comment to be included in a platform's Transfer event.
*
* @return success.
*/
function transferWithReference(address _to, uint _value, string _reference) public returns (bool) {
if (_to != 0x0) {
return _transferWithReference(_to, _value, _reference);
}
else {
return false;
}
}
/**
* Performs transfer call on the platform by the name of specified sender.
*
* Can only be called by asset implementation contract assigned to sender.
*
* @param _to holder address to give to.
* @param _value amount to transfer.
* @param _reference transfer comment to be included in a platform's Transfer event.
* @param _sender initial caller.
*
* @return success.
*/
function __transferWithReference(address _to, uint _value, string _reference, address _sender) public onlyAccess(_sender) returns (bool) {
return platform.proxyTransferWithReference(_to, _value, smbl, _reference, _sender) == OK;
}
/**
* Prforms allowance transfer of asset balance between holders.
*
* @param _from holder address to take from.
* @param _to holder address to give to.
* @param _value amount to transfer.
*
* @return success.
*/
function transferFrom(address _from, address _to, uint _value) public returns (bool) {
if (_to != 0x0) {
return _getAsset().__transferFromWithReference(_from, _to, _value, "", msg.sender);
}
else {
return false;
}
}
/**
* Performs allowance transfer call on the platform by the name of specified sender.
*
* Can only be called by asset implementation contract assigned to sender.
*
* @param _from holder address to take from.
* @param _to holder address to give to.
* @param _value amount to transfer.
* @param _reference transfer comment to be included in a platform's Transfer event.
* @param _sender initial caller.
*
* @return success.
*/
function __transferFromWithReference(address _from, address _to, uint _value, string _reference, address _sender) public onlyAccess(_sender) returns (bool) {
return platform.proxyTransferFromWithReference(_from, _to, _value, smbl, _reference, _sender) == OK;
}
/**
* Sets asset spending allowance for a specified spender.
*
* @param _spender holder address to set allowance to.
* @param _value amount to allow.
*
* @return success.
*/
function approve(address _spender, uint _value) public returns (bool) {
if (_spender != 0x0) {
return _getAsset().__approve(_spender, _value, msg.sender);
}
else {
return false;
}
}
/**
* Performs allowance setting call on the platform by the name of specified sender.
*
* Can only be called by asset implementation contract assigned to sender.
*
* @param _spender holder address to set allowance to.
* @param _value amount to allow.
* @param _sender initial caller.
*
* @return success.
*/
function __approve(address _spender, uint _value, address _sender) public onlyAccess(_sender) returns (bool) {
return platform.proxyApprove(_spender, _value, smbl, _sender) == OK;
}
/**
* Emits ERC20 Transfer event on this contract.
*
* Can only be, and, called by assigned platform when asset transfer happens.
*/
function emitTransfer(address _from, address _to, uint _value) public onlyPlatform() {
Transfer(_from, _to, _value);
}
/**
* Emits ERC20 Approval event on this contract.
*
* Can only be, and, called by assigned platform when asset allowance set happens.
*/
function emitApprove(address _from, address _spender, uint _value) public onlyPlatform() {
Approval(_from, _spender, _value);
}
/**
* Returns current asset implementation contract address.
*
* @return asset implementation contract address.
*/
function getLatestVersion() public view returns (address) {
return latestVersion;
}
/**
* Propose next asset implementation contract address.
*
* Can only be called by current asset owner.
*
* Note: freeze-time should not be applied for the initial setup.
*
* @param _newVersion asset implementation contract address.
*
* @return success.
*/
function proposeUpgrade(address _newVersion) public onlyAssetOwner returns (bool) {
// New version address should be other than 0x0.
if (_newVersion == 0x0) {
return false;
}
latestVersion = _newVersion;
UpgradeProposal(_newVersion);
return true;
}
function isTransferAllowed(address, address, address, address, uint) public view returns (bool) {
return true;
}
/**
* Returns asset implementation contract for current caller.
*
* @return asset implementation contract.
*/
function _getAsset() internal view returns (ATxAssetInterface) {
return ATxAssetInterface(getLatestVersion());
}
/**
* Resolves asset implementation contract for the caller and forwards there arguments along with
* the caller address.
*
* @return success.
*/
function _transferWithReference(address _to, uint _value, string _reference) internal returns (bool) {
return _getAsset().__transferWithReference(_to, _value, _reference, msg.sender);
}
function stringToBytes32(string memory source) private pure returns (bytes32 result) {
assembly {
result := mload(add(source, 32))
}
}
}
contract ATxBuybackInterface {
event EtherReceived(uint amount);
event TokenExchanged(
address recepient,
address token,
uint tokenAmount,
uint etherAmount,
uint feeAmount,
address feeReceiver,
uint price
);
}
/// @title Token Buyback contract.
/// @notice Plays role of token exchange to Ether.
/// Has only one token at a contract. To support other tokens
/// there should be created other ATxBuyback contracts.
contract ATxBuyback is Object, ATxBuybackInterface, ServiceAllowance {
using SafeMath for uint;
struct FeeData {
uint feeValue;
uint feeDecimals;
}
/// @dev Redemption fee collector address
address public rdCollectorAddress;
/// @dev Fee value
FeeData rdFee;
/// @dev Token to exchange.
ATxAssetProxy public token;
/// @dev Price for 1 token
uint public price;
/// @dev Active flag
bool public active;
/// @dev Guards from invocation only when state is active
modifier onlyActive {
if (active) {
_;
}
}
function ATxBuyback(ATxAssetProxy _token) public {
require(address(_token) != 0x0);
token = _token;
}
/// @notice Sets a price (in wei) for selling one token
/// @param _price "in wei" = 1 ATx
function setPrice(uint _price) onlyContractOwner external returns (uint) {
price = _price;
return OK;
}
/// @notice Sets contract to active/non active state.
/// Should be performed only by contract owner.
/// @param _active next state of contract. True to activate a contract
/// @return result code of an operation
function setActive(bool _active) onlyContractOwner external returns (uint) {
if (active == _active) {
return;
}
active = _active;
return OK;
}
/// @notice Setup redemption destination address
/// @param _collectorAddress address where all redemptiom fee will be directed
/// @return result code of an operation
function setRdCollectorAddress(address _collectorAddress) onlyContractOwner external returns (uint) {
require(_collectorAddress != 0x0);
rdCollectorAddress = _collectorAddress;
return OK;
}
/// @notice Setup redemption fee value
/// @param _feeValue fee amount; the minimal value is 1
/// @param _feeDecimals fee decimals, sets a precision for fee value
/// @return result code of an operation
function setRdFee(uint _feeValue, uint _feeDecimals) onlyContractOwner external returns (uint) {
require(_validFee(_feeValue, _feeDecimals));
rdFee = FeeData(_feeValue, _feeDecimals);
return OK;
}
/// @notice Gets redemption fee value
/// @return {
/// "_value": "amount of percents",
/// "_decimals": "percent's precision"
/// }
function getRdFee() public view returns (uint _value, uint _decimals) {
FeeData memory _fee = rdFee;
return (_fee.feeValue, _fee.feeDecimals);
}
/// @notice Withdraws all Ether from buyback contract to specified address.
/// Allowed only for contract owner.
/// @param _to destination address to send Ether
/// @return result code of an operation
function withdrawAllEth(address _to) onlyContractOwner external returns (uint) {
uint _balance = address(this).balance;
if (_balance == 0) {
return 0;
}
_to.transfer(_balance);
return OK;
}
/// ServiceAllowance
///
/// @notice ServiceAllowance interface implementation
/// @dev Should cover conditions for allowance of transfers
function isTransferAllowed(address, address _to, address, address _token, uint) onlyActive public view returns (bool) {
if (_token == address(token) && _to == address(this)) {
return true;
}
}
/// @notice Fallback function for ERC223 standard.
/// Allowed to work only in active state.
/// @param _sender original sender of token transfer
/// @param _value amount of tokens that has been sent
function tokenFallback(address _sender, uint _value, bytes) external {
/// Don't allow to transfer and exchange tokens when Buyback contract
/// is not in 'active' state
if (!active) {
revert();
}
/// This call should be produced by AssetProxy's backend - an Asset contract.
/// Any other call will be followed by revert()
ATxAssetProxy _token = token;
if (msg.sender != _token.getLatestVersion()) {
revert();
}
/// Need to check available ETH balance in order to fulfill holder's request
/// about exchanging ATx Token to ETH equivalent
uint _etherToExchange = _value.mul(price) / (10 ** uint(_token.decimals()));
if (this.balance < _etherToExchange) {
revert();
}
/// To prevent double spending we revoke transferred assets from foundation platform,
ATxPlatformInterface _platform = ATxPlatformInterface(address(_token.platform()));
require(OK == _platform.revokeAsset(_token.smbl(), _value));
/// Take redemption fee and return left amount of Ether to transfer it to a holder
uint _restEther = _takeRdFee(_etherToExchange);
/// Transfer the rest to holder's account
_sender.transfer(_restEther);
/// Voila! Just emit the event to say to the world that one more exchange action was finished
TokenExchanged(_sender, _token, _value, _restEther, _etherToExchange.sub(_restEther), rdCollectorAddress, price);
}
/// @notice Accepts Ether and emits EtherReceived event
function() payable external {
if (msg.value > 0) {
EtherReceived(msg.value);
}
}
/* Internal */
function _takeRdFee(uint _fromValue) private returns (uint _restValue) {
/// Here we check if redemption fee was setup after the contract initialization
FeeData memory _fee = rdFee;
require(_validFee(_fee.feeValue, _fee.feeDecimals));
/// Calculate amount of redemption fee that we have to take from the whole sum
uint _rdFeeEther;
_rdFeeEther = _fromValue.mul(_fee.feeValue).div(10 ** _fee.feeDecimals);
_restValue = _fromValue.sub(_rdFeeEther);
/// At first use method collector.transfer() to ensure that if this move is not possible
/// then revert all changes
address _rdCollectorAddress = rdCollectorAddress;
require(_rdCollectorAddress != 0x0);
_rdCollectorAddress.transfer(_rdFeeEther);
}
function _validFee(uint _value, uint _decimals) private pure returns (bool) {
return _value != 0 && _value / 10 ** _decimals.sub(1) >= 0 && _value / 10 ** _decimals.sub(1) < 10;
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":true,"inputs":[],"name":"active","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRdFee","outputs":[{"name":"_value","type":"uint256"},{"name":"_decimals","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimContractOwnership","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"changeContractOwnership","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pendingContractOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_collectorAddress","type":"address"}],"name":"setRdCollectorAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_price","type":"uint256"}],"name":"setPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_active","type":"bool"}],"name":"setActive","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_feeValue","type":"uint256"},{"name":"_feeDecimals","type":"uint256"}],"name":"setRdFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_sender","type":"address"},{"name":"_value","type":"uint256"},{"name":"","type":"bytes"}],"name":"tokenFallback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rdCollectorAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"_to","type":"address"},{"name":"","type":"address"},{"name":"_token","type":"address"},{"name":"","type":"uint256"}],"name":"isTransferAllowed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contractOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"withdrawAllEth","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"tokens","type":"address[]"},{"name":"_to","type":"address"}],"name":"withdrawnTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"EtherReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"recepient","type":"address"},{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"tokenAmount","type":"uint256"},{"indexed":false,"name":"etherAmount","type":"uint256"},{"indexed":false,"name":"feeAmount","type":"uint256"},{"indexed":false,"name":"feeReceiver","type":"address"},{"indexed":false,"name":"price","type":"uint256"}],"name":"TokenExchanged","type":"event"}]Contract Creation Code
6060604052341561000f57600080fd5b604051602080610db58339810160405280805160008054600160a060020a03191633600160a060020a039081169190911790915590925082161515905061005557600080fd5b60058054600160a060020a031916600160a060020a0392909216919091179055610d31806100846000396000f3006060604052600436106100e25763ffffffff60e060020a60003504166302fb0c5e811461012157806308ee33af146101485780634592cd1d14610173578063557f4bc9146101865780635aa77d3c146101a557806375ace438146101d457806383197ef01461020557806391b7f5ed14610218578063a035b1fe1461022e578063acec338a14610241578063c03bdbae14610259578063c0ee0b8a14610272578063c270ce28146102a1578063c32ee591146102b4578063ce606ee0146102e8578063d46d79bb146102fb578063d8f9659b1461031a578063fc0c546a14610374575b600034111561011f577f0a34e3d4f1e6b837dbce1011b61499fa1a483a0abee6a7a6697660b4b2d971323460405190815260200160405180910390a15b005b341561012c57600080fd5b610134610387565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b610390565b60405191825260208201526040908101905180910390f35b341561017e57600080fd5b6101346103c8565b341561019157600080fd5b610134600160a060020a0360043516610420565b34156101b057600080fd5b6101b861047f565b604051600160a060020a03909116815260200160405180910390f35b34156101df57600080fd5b6101f3600160a060020a036004351661048e565b60405190815260200160405180910390f35b341561021057600080fd5b61011f6104ed565b341561022357600080fd5b6101f3600435610512565b341561023957600080fd5b6101f3610533565b341561024c57600080fd5b6101f36004351515610539565b341561026457600080fd5b6101f360043560243561057e565b341561027d57600080fd5b61011f60048035600160a060020a03169060248035916044359182019101356105da565b34156102ac57600080fd5b6101b861092f565b34156102bf57600080fd5b610134600160a060020a036004358116906024358116906044358116906064351660843561093e565b34156102f357600080fd5b6101b861098c565b341561030657600080fd5b6101f3600160a060020a036004351661099b565b341561032557600080fd5b6101f3600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050509235600160a060020a03169250610a0d915050565b341561037f57600080fd5b6101b8610b5c565b60075460ff1681565b60008061039b610cee565b60036040805190810160405281548152600190910154602082015290508051816020015192509250509091565b60015460009033600160a060020a039081169116146103e95750600061041d565b50600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551681555b90565b6000805433600160a060020a039081169116141561047a57600160a060020a03821615156104505750600061047a565b506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161781555b919050565b600154600160a060020a031681565b6000805433600160a060020a039081169116141561047a57600160a060020a03821615156104bb57600080fd5b5060028054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60005433600160a060020a03908116911614156105105733600160a060020a0316ff5b565b6000805433600160a060020a039081169116141561047a5750600655600190565b60065481565b6000805433600160a060020a039081169116141561047a5760075460ff16151582151514156105675761047a565b506007805460ff1916911515919091179055600190565b6000805433600160a060020a03908116911614156105d4576105a08383610b6b565b15156105ab57600080fd5b604080519081016040528381526020810183905260038151815560208201516001918201559150505b92915050565b60075460009081908190819060ff1615156105f457600080fd5b600554600160a060020a0316935083630e6d1de96000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561063f57600080fd5b6102c65a03f1151561065057600080fd5b50505060405180519050600160a060020a031633600160a060020a031614151561067957600080fd5b83600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106bf57600080fd5b6102c65a03f115156106d057600080fd5b5050506040518051905060ff16600a0a6106f560065489610bcc90919063ffffffff16565b8115156106fe57fe5b0492508230600160a060020a031631101561071857600080fd5b83600160a060020a0316634bde38c86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561075e57600080fd5b6102c65a03f1151561076f57600080fd5b50505060405180519050915081600160a060020a031663ca448a8885600160a060020a031663cb4e75bb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156107d057600080fd5b6102c65a03f115156107e157600080fd5b505050604051805190508960006040516020015260405160e060020a63ffffffff851602815260048101929092526024820152604401602060405180830381600087803b151561083057600080fd5b6102c65a03f1151561084157600080fd5b5050506040518051600114905061085757600080fd5b61086083610bf0565b9050600160a060020a03881681156108fc0282604051600060405180830381858888f19350505050151561089357600080fd5b7fbf7cd8c76679a5af7e65803ef600bcf955fbbaf7972de3861a1f848b3a50159f888589846108c8888263ffffffff610cc516565b600254600654600160a060020a0390911690604051600160a060020a03978816815295871660208701526040808701959095526060860193909352608085019190915290931660a083015260c082019290925260e001905180910390a15050505050505050565b600254600160a060020a031681565b60075460009060ff161561098357600554600160a060020a03848116911614801561097a575030600160a060020a031685600160a060020a0316145b15610983575060015b95945050505050565b600054600160a060020a031681565b60008054819033600160a060020a0390811691161415610a075750600160a060020a033016318015156109d15760009150610a07565b600160a060020a03831681156108fc0282604051600060405180830381858888f193505050501515610a0257600080fd5b600191505b50919050565b6000805481908190819033600160a060020a0390811691161415610b5357600092505b8551831015610b4e57858381518110610a4557fe5b90602001906020020151915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610aa857600080fd5b6102c65a03f11515610ab957600080fd5b50505060405180519150508015610b435781600160a060020a031663a9059cbb868360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b2757600080fd5b6102c65a03f11515610b3857600080fd5b505050604051805150505b600190920191610a30565b600193505b50505092915050565b600554600160a060020a031681565b60008215801590610b9b57506000610b8a83600163ffffffff610cc516565b600a0a84811515610b9757fe5b0410155b8015610bc55750600a610bb583600163ffffffff610cc516565b600a0a84811515610bc257fe5b04105b9392505050565b6000828202831580610be85750828482811515610be557fe5b04145b1515610bc557fe5b6000610bfa610cee565b6000806003604080519081016040528154815260019091015460208201529250610c2983518460200151610b6b565b1515610c3457600080fd5b610c5d8360200151600a0a610c518551889063ffffffff610bcc16565b9063ffffffff610cd716565b9150610c6f858363ffffffff610cc516565b600254909450600160a060020a03169050801515610c8c57600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f193505050501515610cbd57600080fd5b505050919050565b600082821115610cd157fe5b50900390565b6000808284811515610ce557fe5b04949350505050565b6040805190810160405260008082526020820152905600a165627a7a7230582081e00385419413a9285701c1806c231364f2830fe6a590e3c06da3b1713cc41f002900000000000000000000000030f2d215c9091dd230f988a6f24a1176ceca2ecd
Deployed Bytecode
0x6060604052600436106100e25763ffffffff60e060020a60003504166302fb0c5e811461012157806308ee33af146101485780634592cd1d14610173578063557f4bc9146101865780635aa77d3c146101a557806375ace438146101d457806383197ef01461020557806391b7f5ed14610218578063a035b1fe1461022e578063acec338a14610241578063c03bdbae14610259578063c0ee0b8a14610272578063c270ce28146102a1578063c32ee591146102b4578063ce606ee0146102e8578063d46d79bb146102fb578063d8f9659b1461031a578063fc0c546a14610374575b600034111561011f577f0a34e3d4f1e6b837dbce1011b61499fa1a483a0abee6a7a6697660b4b2d971323460405190815260200160405180910390a15b005b341561012c57600080fd5b610134610387565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b610390565b60405191825260208201526040908101905180910390f35b341561017e57600080fd5b6101346103c8565b341561019157600080fd5b610134600160a060020a0360043516610420565b34156101b057600080fd5b6101b861047f565b604051600160a060020a03909116815260200160405180910390f35b34156101df57600080fd5b6101f3600160a060020a036004351661048e565b60405190815260200160405180910390f35b341561021057600080fd5b61011f6104ed565b341561022357600080fd5b6101f3600435610512565b341561023957600080fd5b6101f3610533565b341561024c57600080fd5b6101f36004351515610539565b341561026457600080fd5b6101f360043560243561057e565b341561027d57600080fd5b61011f60048035600160a060020a03169060248035916044359182019101356105da565b34156102ac57600080fd5b6101b861092f565b34156102bf57600080fd5b610134600160a060020a036004358116906024358116906044358116906064351660843561093e565b34156102f357600080fd5b6101b861098c565b341561030657600080fd5b6101f3600160a060020a036004351661099b565b341561032557600080fd5b6101f3600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050509235600160a060020a03169250610a0d915050565b341561037f57600080fd5b6101b8610b5c565b60075460ff1681565b60008061039b610cee565b60036040805190810160405281548152600190910154602082015290508051816020015192509250509091565b60015460009033600160a060020a039081169116146103e95750600061041d565b50600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a038416179091551681555b90565b6000805433600160a060020a039081169116141561047a57600160a060020a03821615156104505750600061047a565b506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161781555b919050565b600154600160a060020a031681565b6000805433600160a060020a039081169116141561047a57600160a060020a03821615156104bb57600080fd5b5060028054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b60005433600160a060020a03908116911614156105105733600160a060020a0316ff5b565b6000805433600160a060020a039081169116141561047a5750600655600190565b60065481565b6000805433600160a060020a039081169116141561047a5760075460ff16151582151514156105675761047a565b506007805460ff1916911515919091179055600190565b6000805433600160a060020a03908116911614156105d4576105a08383610b6b565b15156105ab57600080fd5b604080519081016040528381526020810183905260038151815560208201516001918201559150505b92915050565b60075460009081908190819060ff1615156105f457600080fd5b600554600160a060020a0316935083630e6d1de96000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561063f57600080fd5b6102c65a03f1151561065057600080fd5b50505060405180519050600160a060020a031633600160a060020a031614151561067957600080fd5b83600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106bf57600080fd5b6102c65a03f115156106d057600080fd5b5050506040518051905060ff16600a0a6106f560065489610bcc90919063ffffffff16565b8115156106fe57fe5b0492508230600160a060020a031631101561071857600080fd5b83600160a060020a0316634bde38c86000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561075e57600080fd5b6102c65a03f1151561076f57600080fd5b50505060405180519050915081600160a060020a031663ca448a8885600160a060020a031663cb4e75bb6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156107d057600080fd5b6102c65a03f115156107e157600080fd5b505050604051805190508960006040516020015260405160e060020a63ffffffff851602815260048101929092526024820152604401602060405180830381600087803b151561083057600080fd5b6102c65a03f1151561084157600080fd5b5050506040518051600114905061085757600080fd5b61086083610bf0565b9050600160a060020a03881681156108fc0282604051600060405180830381858888f19350505050151561089357600080fd5b7fbf7cd8c76679a5af7e65803ef600bcf955fbbaf7972de3861a1f848b3a50159f888589846108c8888263ffffffff610cc516565b600254600654600160a060020a0390911690604051600160a060020a03978816815295871660208701526040808701959095526060860193909352608085019190915290931660a083015260c082019290925260e001905180910390a15050505050505050565b600254600160a060020a031681565b60075460009060ff161561098357600554600160a060020a03848116911614801561097a575030600160a060020a031685600160a060020a0316145b15610983575060015b95945050505050565b600054600160a060020a031681565b60008054819033600160a060020a0390811691161415610a075750600160a060020a033016318015156109d15760009150610a07565b600160a060020a03831681156108fc0282604051600060405180830381858888f193505050501515610a0257600080fd5b600191505b50919050565b6000805481908190819033600160a060020a0390811691161415610b5357600092505b8551831015610b4e57858381518110610a4557fe5b90602001906020020151915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610aa857600080fd5b6102c65a03f11515610ab957600080fd5b50505060405180519150508015610b435781600160a060020a031663a9059cbb868360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610b2757600080fd5b6102c65a03f11515610b3857600080fd5b505050604051805150505b600190920191610a30565b600193505b50505092915050565b600554600160a060020a031681565b60008215801590610b9b57506000610b8a83600163ffffffff610cc516565b600a0a84811515610b9757fe5b0410155b8015610bc55750600a610bb583600163ffffffff610cc516565b600a0a84811515610bc257fe5b04105b9392505050565b6000828202831580610be85750828482811515610be557fe5b04145b1515610bc557fe5b6000610bfa610cee565b6000806003604080519081016040528154815260019091015460208201529250610c2983518460200151610b6b565b1515610c3457600080fd5b610c5d8360200151600a0a610c518551889063ffffffff610bcc16565b9063ffffffff610cd716565b9150610c6f858363ffffffff610cc516565b600254909450600160a060020a03169050801515610c8c57600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f193505050501515610cbd57600080fd5b505050919050565b600082821115610cd157fe5b50900390565b6000808284811515610ce557fe5b04949350505050565b6040805190810160405260008082526020820152905600a165627a7a7230582081e00385419413a9285701c1806c231364f2830fe6a590e3c06da3b1713cc41f0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000030f2d215c9091dd230f988a6f24a1176ceca2ecd
-----Decoded View---------------
Arg [0] : _token (address): 0x30F2D215C9091dD230F988a6f24A1176cEca2ECd
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000030f2d215c9091dd230f988a6f24a1176ceca2ecd
Swarm Source
bzzr://81e00385419413a9285701c1806c231364f2830fe6a590e3c06da3b1713cc41f
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.