Change Network

Use the search box to find a hosted network, or select from the list of available networks below.

All
Mainnet
Testnet
Favorites
No content.

Contract Address Details

0x407312700753A7d728984715339Ec47Cbb158636

ForeignBridgeErcToErc >= 0 Incoming Transactions Last Balance Update: Block #8303414
Created by 0x5f97–3154d7 at 0x1098–948e07

Balance

0 ETH

(@ /ETH)

Fetching tokens...

Contract name:
ForeignBridgeErcToErc




Optimization enabled
true
Compiler version
v0.4.24+commit.e67f0147




Optimization runs
200
EVM Version
petersburg

Contract source code

pragma solidity 0.4.24;
// File: contracts/ERC677Receiver.sol
contract ERC677Receiver {
function onTokenTransfer(address _from, uint _value, bytes _data) external returns(bool);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: contracts/ERC677.sol
contract ERC677 is ERC20 {
event Transfer(address indexed from, address indexed to, uint value, bytes data);
function transferAndCall(address, uint, bytes) external returns (bool);
}
// File: contracts/IBurnableMintableERC677Token.sol
contract IBurnableMintableERC677Token is ERC677 {
function mint(address, uint256) public returns (bool);
function burn(uint256 _value) public;
function claimTokens(address _token, address _to) public;
}
// File: contracts/IBridgeValidators.sol
interface IBridgeValidators {
function isValidator(address _validator) public view returns(bool);
function requiredSignatures() public view returns(uint256);
function owner() public view returns(address);
}
// File: contracts/libraries/Message.sol
library Message {
// function uintToString(uint256 inputValue) internal pure returns (string) {
// // figure out the length of the resulting string
// uint256 length = 0;
// uint256 currentValue = inputValue;
// do {
// length++;
// currentValue /= 10;
// } while (currentValue != 0);
// // allocate enough memory
// bytes memory result = new bytes(length);
// // construct the string backwards
// uint256 i = length - 1;
// currentValue = inputValue;
// do {
// result[i--] = byte(48 + currentValue % 10);
// currentValue /= 10;
// } while (currentValue != 0);
// return string(result);
// }
function addressArrayContains(address[] array, address value) internal pure returns (bool) {
for (uint256 i = 0; i < array.length; i++) {
if (array[i] == value) {
return true;
}
}
return false;
}
// layout of message :: bytes:
// offset 0: 32 bytes :: uint256 - message length
// offset 32: 20 bytes :: address - recipient address
// offset 52: 32 bytes :: uint256 - value
// offset 84: 32 bytes :: bytes32 - transaction hash
// offset 104: 20 bytes :: address - contract address to prevent double spending
// bytes 1 to 32 are 0 because message length is stored as little endian.
// mload always reads 32 bytes.
// so we can and have to start reading recipient at offset 20 instead of 32.
// if we were to read at 32 the address would contain part of value and be corrupted.
// when reading from offset 20 mload will read 12 zero bytes followed
// by the 20 recipient address bytes and correctly convert it into an address.
// this saves some storage/gas over the alternative solution
// which is padding address to 32 bytes and reading recipient at offset 32.
// for more details see discussion in:
// https://github.com/paritytech/parity-bridge/issues/61
function parseMessage(bytes message)
internal
pure
returns(address recipient, uint256 amount, bytes32 txHash, address contractAddress)
{
require(isMessageValid(message));
assembly {
recipient := and(mload(add(message, 20)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
amount := mload(add(message, 52))
txHash := mload(add(message, 84))
contractAddress := mload(add(message, 104))
}
}
function isMessageValid(bytes _msg) internal pure returns(bool) {
return _msg.length == requiredMessageLength();
}
function requiredMessageLength() internal pure returns(uint256) {
return 104;
}
function recoverAddressFromSignedMessage(bytes signature, bytes message) internal pure returns (address) {
require(signature.length == 65);
bytes32 r;
bytes32 s;
bytes1 v;
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := mload(add(signature, 0x60))
}
return ecrecover(hashMessage(message), uint8(v), r, s);
}
function hashMessage(bytes message) internal pure returns (bytes32) {
bytes memory prefix = "\x19Ethereum Signed Message:\n";
// message is always 84 length
string memory msgLength = "104";
return keccak256(abi.encodePacked(prefix, msgLength, message));
}
function hasEnoughValidSignatures(
bytes _message,
uint8[] _vs,
bytes32[] _rs,
bytes32[] _ss,
IBridgeValidators _validatorContract) internal view {
require(isMessageValid(_message));
uint256 requiredSignatures = _validatorContract.requiredSignatures();
require(_vs.length >= requiredSignatures);
bytes32 hash = hashMessage(_message);
address[] memory encounteredAddresses = new address[](requiredSignatures);
for (uint256 i = 0; i < requiredSignatures; i++) {
address recoveredAddress = ecrecover(hash, _vs[i], _rs[i], _ss[i]);
require(_validatorContract.isValidator(recoveredAddress));
if (addressArrayContains(encounteredAddresses, recoveredAddress)) {
revert();
}
encounteredAddresses[i] = recoveredAddress;
}
}
}
// File: contracts/libraries/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
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;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/upgradeability/EternalStorage.sol
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
mapping(bytes32 => uint256) internal uintStorage;
mapping(bytes32 => string) internal stringStorage;
mapping(bytes32 => address) internal addressStorage;
mapping(bytes32 => bytes) internal bytesStorage;
mapping(bytes32 => bool) internal boolStorage;
mapping(bytes32 => int256) internal intStorage;
}
// File: contracts/upgradeable_contracts/Ownable.sol
/**
* @title Ownable
* @dev This contract has an owner address providing basic authorization control
*/
contract Ownable is EternalStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event OwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner());
_;
}
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function owner() public view returns (address) {
return addressStorage[keccak256(abi.encodePacked("owner"))];
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner the address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
setOwner(newOwner);
}
/**
* @dev Sets a new owner address
*/
function setOwner(address newOwner) internal {
emit OwnershipTransferred(owner(), newOwner);
addressStorage[keccak256(abi.encodePacked("owner"))] = newOwner;
}
}
// File: contracts/IOwnedUpgradeabilityProxy.sol
interface IOwnedUpgradeabilityProxy {
function proxyOwner() public view returns (address);
}
// File: contracts/upgradeable_contracts/OwnedUpgradeability.sol
contract OwnedUpgradeability {
function upgradeabilityAdmin() public view returns (address) {
return IOwnedUpgradeabilityProxy(this).proxyOwner();
}
// Avoid using onlyProxyOwner name to prevent issues with implementation from proxy contract
modifier onlyIfOwnerOfProxy() {
require(msg.sender == upgradeabilityAdmin());
_;
}
}
// File: contracts/upgradeable_contracts/Validatable.sol
contract Validatable is EternalStorage {
function validatorContract() public view returns(IBridgeValidators) {
return IBridgeValidators(addressStorage[keccak256(abi.encodePacked("validatorContract"))]);
}
modifier onlyValidator() {
require(validatorContract().isValidator(msg.sender));
_;
}
function requiredSignatures() public view returns(uint256) {
return validatorContract().requiredSignatures();
}
}
// File: contracts/upgradeable_contracts/BasicBridge.sol
contract BasicBridge is EternalStorage, Validatable, Ownable, OwnedUpgradeability {
using SafeMath for uint256;
event GasPriceChanged(uint256 gasPrice);
event RequiredBlockConfirmationChanged(uint256 requiredBlockConfirmations);
event DailyLimitChanged(uint256 newLimit);
event ExecutionDailyLimitChanged(uint256 newLimit);
function getBridgeInterfacesVersion() public pure returns(uint64 major, uint64 minor, uint64 patch) {
return (2, 2, 0);
}
function setGasPrice(uint256 _gasPrice) public onlyOwner {
require(_gasPrice > 0);
uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _gasPrice;
emit GasPriceChanged(_gasPrice);
}
function gasPrice() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("gasPrice"))];
}
function setRequiredBlockConfirmations(uint256 _blockConfirmations) public onlyOwner {
require(_blockConfirmations > 0);
uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _blockConfirmations;
emit RequiredBlockConfirmationChanged(_blockConfirmations);
}
function requiredBlockConfirmations() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))];
}
function deployedAtBlock() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))];
}
function setTotalSpentPerDay(uint256 _day, uint256 _value) internal {
uintStorage[keccak256(abi.encodePacked("totalSpentPerDay", _day))] = _value;
}
function totalSpentPerDay(uint256 _day) public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("totalSpentPerDay", _day))];
}
function setTotalExecutedPerDay(uint256 _day, uint256 _value) internal {
uintStorage[keccak256(abi.encodePacked("totalExecutedPerDay", _day))] = _value;
}
function totalExecutedPerDay(uint256 _day) public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("totalExecutedPerDay", _day))];
}
function minPerTx() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("minPerTx"))];
}
function maxPerTx() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("maxPerTx"))];
}
function executionMaxPerTx() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("executionMaxPerTx"))];
}
function setInitialize(bool _status) internal {
boolStorage[keccak256(abi.encodePacked("isInitialized"))] = _status;
}
function isInitialized() public view returns(bool) {
return boolStorage[keccak256(abi.encodePacked("isInitialized"))];
}
function getCurrentDay() public view returns(uint256) {
return now / 1 days;
}
function setDailyLimit(uint256 _dailyLimit) public onlyOwner {
uintStorage[keccak256(abi.encodePacked("dailyLimit"))] = _dailyLimit;
emit DailyLimitChanged(_dailyLimit);
}
function dailyLimit() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("dailyLimit"))];
}
function setExecutionDailyLimit(uint256 _dailyLimit) public onlyOwner {
uintStorage[keccak256(abi.encodePacked("executionDailyLimit"))] = _dailyLimit;
emit ExecutionDailyLimitChanged(_dailyLimit);
}
function executionDailyLimit() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("executionDailyLimit"))];
}
function setExecutionMaxPerTx(uint256 _maxPerTx) external onlyOwner {
require(_maxPerTx < executionDailyLimit());
uintStorage[keccak256(abi.encodePacked("executionMaxPerTx"))] = _maxPerTx;
}
function setMaxPerTx(uint256 _maxPerTx) external onlyOwner {
require(_maxPerTx < dailyLimit());
uintStorage[keccak256(abi.encodePacked("maxPerTx"))] = _maxPerTx;
}
function setMinPerTx(uint256 _minPerTx) external onlyOwner {
require(_minPerTx < dailyLimit() && _minPerTx < maxPerTx());
uintStorage[keccak256(abi.encodePacked("minPerTx"))] = _minPerTx;
}
function withinLimit(uint256 _amount) public view returns(bool) {
uint256 nextLimit = totalSpentPerDay(getCurrentDay()).add(_amount);
return dailyLimit() >= nextLimit && _amount <= maxPerTx() && _amount >= minPerTx();
}
function withinExecutionLimit(uint256 _amount) public view returns(bool) {
uint256 nextLimit = totalExecutedPerDay(getCurrentDay()).add(_amount);
return executionDailyLimit() >= nextLimit && _amount <= executionMaxPerTx();
}
function claimTokens(address _token, address _to) public onlyIfOwnerOfProxy {
require(_to != address(0));
if (_token == address(0)) {
_to.transfer(address(this).balance);
return;
}
ERC20Basic token = ERC20Basic(_token);
uint256 balance = token.balanceOf(this);
require(token.transfer(_to, balance));
}
function isContract(address _addr) internal view returns (bool)
{
uint length;
assembly { length := extcodesize(_addr) }
return length > 0;
}
}
// File: contracts/upgradeable_contracts/BasicForeignBridge.sol
contract BasicForeignBridge is EternalStorage, Validatable {
using SafeMath for uint256;
/// triggered when relay of deposit from HomeBridge is complete
event RelayedMessage(address recipient, uint value, bytes32 transactionHash);
function executeSignatures(uint8[] vs, bytes32[] rs, bytes32[] ss, bytes message) external {
Message.hasEnoughValidSignatures(message, vs, rs, ss, validatorContract());
address recipient;
uint256 amount;
bytes32 txHash;
address contractAddress;
(recipient, amount, txHash, contractAddress) = Message.parseMessage(message);
if (messageWithinLimits(amount)) {
require(contractAddress == address(this));
require(!relayedMessages(txHash));
setRelayedMessages(txHash, true);
require(onExecuteMessage(recipient, amount));
emit RelayedMessage(recipient, amount, txHash);
} else {
onFailedMessage(recipient, amount, txHash);
}
}
function onExecuteMessage(address, uint256) internal returns(bool);
function setRelayedMessages(bytes32 _txHash, bool _status) internal {
boolStorage[keccak256(abi.encodePacked("relayedMessages", _txHash))] = _status;
}
function relayedMessages(bytes32 _txHash) public view returns(bool) {
return boolStorage[keccak256(abi.encodePacked("relayedMessages", _txHash))];
}
function messageWithinLimits(uint256) internal view returns(bool);
function onFailedMessage(address, uint256, bytes32) internal;
}
// File: contracts/upgradeable_contracts/erc20_to_erc20/ForeignBridgeErcToErc.sol
contract ForeignBridgeErcToErc is BasicBridge, BasicForeignBridge {
event RelayedMessage(address recipient, uint value, bytes32 transactionHash);
function initialize(
address _validatorContract,
address _erc20token,
uint256 _requiredBlockConfirmations,
uint256 _gasPrice,
uint256 _maxPerTx,
uint256 _homeDailyLimit,
uint256 _homeMaxPerTx,
address _owner
) public returns(bool) {
require(!isInitialized());
require(_validatorContract != address(0) && isContract(_validatorContract));
require(_requiredBlockConfirmations != 0);
require(_gasPrice > 0);
require(_homeMaxPerTx < _homeDailyLimit);
require(_owner != address(0));
addressStorage[keccak256(abi.encodePacked("validatorContract"))] = _validatorContract;
setErc20token(_erc20token);
uintStorage[keccak256(abi.encodePacked("deployedAtBlock"))] = block.number;
uintStorage[keccak256(abi.encodePacked("requiredBlockConfirmations"))] = _requiredBlockConfirmations;
uintStorage[keccak256(abi.encodePacked("gasPrice"))] = _gasPrice;
uintStorage[keccak256(abi.encodePacked("maxPerTx"))] = _maxPerTx;
uintStorage[keccak256(abi.encodePacked("executionDailyLimit"))] = _homeDailyLimit;
uintStorage[keccak256(abi.encodePacked("executionMaxPerTx"))] = _homeMaxPerTx;
setOwner(_owner);
setInitialize(true);
return isInitialized();
}
function getBridgeMode() public pure returns(bytes4 _data) {
return bytes4(keccak256(abi.encodePacked("erc-to-erc-core")));
}
function claimTokens(address _token, address _to) public onlyIfOwnerOfProxy {
require(_token != address(erc20token()));
super.claimTokens(_token, _to);
}
function erc20token() public view returns(ERC20Basic) {
return ERC20Basic(addressStorage[keccak256(abi.encodePacked("erc20token"))]);
}
function onExecuteMessage(address _recipient, uint256 _amount) internal returns(bool){
setTotalExecutedPerDay(getCurrentDay(), totalExecutedPerDay(getCurrentDay()).add(_amount));
return erc20token().transfer(_recipient, _amount);
}
function setErc20token(address _token) private {
require(_token != address(0) && isContract(_token));
addressStorage[keccak256(abi.encodePacked("erc20token"))] = _token;
}
function messageWithinLimits(uint256 _amount) internal view returns(bool) {
return withinExecutionLimit(_amount);
}
function onFailedMessage(address, uint256, bytes32) internal {
revert();
}
}

Contract ABI

[{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"erc20token","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"relayedMessages","inputs":[{"type":"bytes32","name":"_txHash"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"executeSignatures","inputs":[{"type":"uint8[]","name":"vs"},{"type":"bytes32[]","name":"rs"},{"type":"bytes32[]","name":"ss"},{"type":"bytes","name":"message"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[{"type":"bool","name":""}],"name":"initialize","inputs":[{"type":"address","name":"_validatorContract"},{"type":"address","name":"_erc20token"},{"type":"uint256","name":"_requiredBlockConfirmations"},{"type":"uint256","name":"_gasPrice"},{"type":"uint256","name":"_maxPerTx"},{"type":"uint256","name":"_homeDailyLimit"},{"type":"uint256","name":"_homeMaxPerTx"},{"type":"address","name":"_owner"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"totalSpentPerDay","inputs":[{"type":"uint256","name":"_day"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"isInitialized","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setExecutionDailyLimit","inputs":[{"type":"uint256","name":"_dailyLimit"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"getCurrentDay","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"requiredBlockConfirmations","inputs":[],"constant":true},{"type":"function","stateMutability":"pure","payable":false,"outputs":[{"type":"bytes4","name":"_data"}],"name":"getBridgeMode","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"executionDailyLimit","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"totalExecutedPerDay","inputs":[{"type":"uint256","name":"_day"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"dailyLimit","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"claimTokens","inputs":[{"type":"address","name":"_token"},{"type":"address","name":"_to"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"withinExecutionLimit","inputs":[{"type":"uint256","name":"_amount"}],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"executionMaxPerTx","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"requiredSignatures","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"owner","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"validatorContract","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"deployedAtBlock","inputs":[],"constant":true},{"type":"function","stateMutability":"pure","payable":false,"outputs":[{"type":"uint64","name":"major"},{"type":"uint64","name":"minor"},{"type":"uint64","name":"patch"}],"name":"getBridgeInterfacesVersion","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setMinPerTx","inputs":[{"type":"uint256","name":"_minPerTx"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setRequiredBlockConfirmations","inputs":[{"type":"uint256","name":"_blockConfirmations"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setDailyLimit","inputs":[{"type":"uint256","name":"_dailyLimit"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setGasPrice","inputs":[{"type":"uint256","name":"_gasPrice"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setMaxPerTx","inputs":[{"type":"uint256","name":"_maxPerTx"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":""}],"name":"upgradeabilityAdmin","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"minPerTx","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":""}],"name":"withinLimit","inputs":[{"type":"uint256","name":"_amount"}],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setExecutionMaxPerTx","inputs":[{"type":"uint256","name":"_maxPerTx"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"maxPerTx","inputs":[],"constant":true},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"uint256","name":""}],"name":"gasPrice","inputs":[],"constant":true},{"type":"event","name":"RelayedMessage","inputs":[{"type":"address","name":"recipient","indexed":false},{"type":"uint256","name":"value","indexed":false},{"type":"bytes32","name":"transactionHash","indexed":false}],"anonymous":false},{"type":"event","name":"GasPriceChanged","inputs":[{"type":"uint256","name":"gasPrice","indexed":false}],"anonymous":false},{"type":"event","name":"RequiredBlockConfirmationChanged","inputs":[{"type":"uint256","name":"requiredBlockConfirmations","indexed":false}],"anonymous":false},{"type":"event","name":"DailyLimitChanged","inputs":[{"type":"uint256","name":"newLimit","indexed":false}],"anonymous":false},{"type":"event","name":"ExecutionDailyLimitChanged","inputs":[{"type":"uint256","name":"newLimit","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","indexed":false},{"type":"address","name":"newOwner","indexed":false}],"anonymous":false}]
            

Contract Byte Code

0x6080604052600436106101875763ffffffff60e060020a6000350416631dcea427811461018c57806321d800ec146101bd578063232a2c1d146101e95780632aa2c3811461022f5780632bd0bb0514610270578063392e53cd1461029a5780633dd95d1b146102af5780633e6968b6146102c75780633f0a9f65146102dc578063437764df146102f157806343b37dd31461033b5780634fb3fef71461035057806367eeba0c1461036857806369ffa08a1461037d578063879ce676146103a45780638aa1949a146103bc5780638d068043146103d15780638da5cb5b146103e657806399439089146103fb5780639a454b99146104105780639cb7595a14610425578063a2a6ca2714610466578063acf5c6891461047e578063b20d30a914610496578063bf1fe420146104ae578063c6f6f216146104c6578063df0ad3de146104de578063df25f3f0146104f3578063ea9f496814610508578063f20151e114610520578063f2fde38b14610538578063f968adbe14610559578063fe173b971461056e575b600080fd5b34801561019857600080fd5b506101a1610583565b60408051600160a060020a039092168252519081900360200190f35b3480156101c957600080fd5b506101d5600435610641565b604080519115158252519081900360200190f35b3480156101f557600080fd5b5061022d602460048035828101929082013591813580830192908201359160443580830192908201359160643591820191013561070a565b005b34801561023b57600080fd5b506101d5600160a060020a0360043581169060243581169060443590606435906084359060a4359060c4359060e435166108e2565b34801561027c57600080fd5b50610288600435610e69565b60408051918252519081900360200190f35b3480156102a657600080fd5b506101d5610f26565b3480156102bb57600080fd5b5061022d600435610fde565b3480156102d357600080fd5b506102886110e0565b3480156102e857600080fd5b506102886110e9565b3480156102fd57600080fd5b5061030661119d565b604080517fffffffff000000000000000000000000000000000000000000000000000000009092168252519081900360200190f35b34801561034757600080fd5b50610288611240565b34801561035c57600080fd5b506102886004356112b3565b34801561037457600080fd5b5061028861132e565b34801561038957600080fd5b5061022d600160a060020a03600435811690602435166113a1565b3480156103b057600080fd5b506101d56004356113eb565b3480156103c857600080fd5b50610288611435565b3480156103dd57600080fd5b506102886114a8565b3480156103f257600080fd5b506101a1611520565b34801561040757600080fd5b506101a1611594565b34801561041c57600080fd5b50610288611608565b34801561043157600080fd5b5061043a61167b565b6040805167ffffffffffffffff9485168152928416602084015292168183015290519081900360600190f35b34801561047257600080fd5b5061022d600435611685565b34801561048a57600080fd5b5061022d60043561177c565b3480156104a257600080fd5b5061022d60043561188b565b3480156104ba57600080fd5b5061022d60043561198d565b3480156104d257600080fd5b5061022d600435611a9c565b3480156104ea57600080fd5b506101a1611b3d565b3480156104ff57600080fd5b50610288611b7d565b34801561051457600080fd5b506101d5600435611bf0565b34801561052c57600080fd5b5061022d600435611c40565b34801561054457600080fd5b5061022d600160a060020a0360043516611ce1565b34801561056557600080fd5b50610288611d1e565b34801561057a57600080fd5b50610288611d91565b60006002600060405160200180807f6572633230746f6b656e00000000000000000000000000000000000000000000815250600a0190506040516020818303038152906040526040518082805190602001908083835b602083106105f85780518252601f1990920191602091820191016105d9565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528501959095529290920160002054600160a060020a0316949350505050565b6000600460008360405160200180807f72656c617965644d657373616765730000000000000000000000000000000000815250600f0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106106c65780518252601f1990920191602091820191016106a7565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205460ff1695945050505050565b6000806000806107e286868080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050508d8d808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050508c8c808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050508b8b80806020026020016040519081016040528093929190818152602001838360200280828437506107dd94506115949350505050565b611e04565b61081b86868080601f01602080910402602001604051908101604052809392919081815260200183838082843750612071945050505050565b9296509094509250905061082e836120b7565b156108c957600160a060020a038116301461084857600080fd5b61085182610641565b1561085b57600080fd5b6108668260016120c8565b610870848461219a565b151561087b57600080fd5b60408051600160a060020a03861681526020810185905280820184905290517f4ab7d581336d92edbea22636a613e8e76c99ac7f91137c1523db38dbfb3bf3299181900360600190a16108d4565b6108d4848484610187565b505050505050505050505050565b60006108ec610f26565b156108f657600080fd5b600160a060020a03891615801590610912575061091289612258565b151561091d57600080fd5b86151561092957600080fd5b6000861161093657600080fd5b83831061094257600080fd5b600160a060020a038216151561095757600080fd5b886002600060405160200180807f76616c696461746f72436f6e747261637400000000000000000000000000000081525060110190506040516020818303038152906040526040518082805190602001908083835b602083106109cb5780518252601f1990920191602091820191016109ac565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03959095169490941790935550610a3c9150899050612260565b4360008060405160200180807f6465706c6f7965644174426c6f636b0000000000000000000000000000000000815250600f0190506040516020818303038152906040526040518082805190602001908083835b60208310610aaf5780518252601f199092019160209182019101610a90565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528581019690965250928301600090812095909555505080517f7265717569726564426c6f636b436f6e6669726d6174696f6e73000000000000818401528151601a818303018152603a9091019182905280518b949384939182918401908083835b60208310610b595780518252601f199092019160209182019101610b3a565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528581019690965250928301600090812095909555505080517f6761735072696365000000000000000000000000000000000000000000000000818401528151600881830301815260289091019182905280518a949384939182918401908083835b60208310610c035780518252601f199092019160209182019101610be4565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528581019690965250928301600090812095909555505080517f6d617850657254780000000000000000000000000000000000000000000000008184015281516008818303018152602890910191829052805189949384939182918401908083835b60208310610cad5780518252601f199092019160209182019101610c8e565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528581019690965250928301600090812095909555505080517f657865637574696f6e4461696c794c696d6974000000000000000000000000008184015281516013818303018152603390910191829052805188949384939182918401908083835b60208310610d575780518252601f199092019160209182019101610d38565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528581019690965250928301600090812095909555505080517f657865637574696f6e4d617850657254780000000000000000000000000000008184015281516011818303018152603190910191829052805187949384939182918401908083835b60208310610e015780518252601f199092019160209182019101610de2565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000209390935550610e4a9150839050612364565b610e546001612422565b610e5c610f26565b9998505050505050505050565b60008060008360405160200180807f746f74616c5370656e74506572446179000000000000000000000000000000008152506010018281526020019150506040516020818303038152906040526040518082805190602001908083835b60208310610ee55780518252601f199092019160209182019101610ec6565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205495945050505050565b60006004600060405160200180807f6973496e697469616c697a656400000000000000000000000000000000000000815250600d0190506040516020818303038152906040526040518082805190602001908083835b60208310610f9b5780518252601f199092019160209182019101610f7c565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205460ff16949350505050565b610fe6611520565b600160a060020a03163314610ffa57600080fd5b8060008060405160200180807f657865637574696f6e4461696c794c696d69740000000000000000000000000081525060130190506040516020818303038152906040526040518082805190602001908083835b6020831061106d5780518252601f19909201916020918201910161104e565b51815160001960209485036101000a019081169019919091161790526040805194909201849003909320865285830196909652509284016000209490945550815184815291517f9bebf928b90863f24cc31f726a3a7545efd409f1dcf552301b1ee3710da70d3b9350918290030190a150565b62015180420490565b600080600060405160200180807f7265717569726564426c6f636b436f6e6669726d6174696f6e73000000000000815250601a0190506040516020818303038152906040526040518082805190602001908083835b6020831061115d5780518252601f19909201916020918201910161113e565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528501959095529290920160002054949350505050565b600060405160200180807f6572632d746f2d6572632d636f72650000000000000000000000000000000000815250600f0190506040516020818303038152906040526040518082805190602001908083835b6020831061120e5780518252601f1990920191602091820191016111ef565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905090565b600080600060405160200180807f657865637574696f6e4461696c794c696d69740000000000000000000000000081525060130190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b60008060008360405160200180807f746f74616c45786563757465645065724461790000000000000000000000000081525060130182815260200191505060405160208183030381529060405260405180828051906020019080838360208310610ee55780518252601f199092019160209182019101610ec6565b600080600060405160200180807f6461696c794c696d697400000000000000000000000000000000000000000000815250600a0190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b6113a9611b3d565b600160a060020a031633146113bd57600080fd5b6113c5610583565b600160a060020a03838116911614156113dd57600080fd5b6113e782826124e3565b5050565b60008061140e836114026113fd6110e0565b6112b3565b9063ffffffff61269f16565b905080611419611240565b1015801561142e575061142a611435565b8311155b9392505050565b600080600060405160200180807f657865637574696f6e4d6178506572547800000000000000000000000000000081525060110190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b60006114b2611594565b600160a060020a0316638d0680436040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156114ef57600080fd5b505af1158015611503573d6000803e3d6000fd5b505050506040513d602081101561151957600080fd5b5051905090565b60006002600060405160200180807f6f776e65720000000000000000000000000000000000000000000000000000008152506005019050604051602081830303815290604052604051808280519060200190808383602083106105f85780518252601f1990920191602091820191016105d9565b60006002600060405160200180807f76616c696461746f72436f6e74726163740000000000000000000000000000008152506011019050604051602081830303815290604052604051808280519060200190808383602083106105f85780518252601f1990920191602091820191016105d9565b600080600060405160200180807f6465706c6f7965644174426c6f636b0000000000000000000000000000000000815250600f0190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b6002806000909192565b61168d611520565b600160a060020a031633146116a157600080fd5b6116a961132e565b811080156116bd57506116ba611d1e565b81105b15156116c857600080fd5b8060008060405160200180807f6d696e506572547800000000000000000000000000000000000000000000000081525060080190506040516020818303038152906040526040518082805190602001908083835b6020831061173b5780518252601f19909201916020918201910161171c565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000209390935550505050565b611784611520565b600160a060020a0316331461179857600080fd5b600081116117a557600080fd5b8060008060405160200180807f7265717569726564426c6f636b436f6e6669726d6174696f6e73000000000000815250601a0190506040516020818303038152906040526040518082805190602001908083835b602083106118185780518252601f1990920191602091820191016117f9565b51815160001960209485036101000a019081169019919091161790526040805194909201849003909320865285830196909652509284016000209490945550815184815291517f4fb76205cd57c896b21511d2114137d8e901b4ccd659e1a0f97d6306795264fb9350918290030190a150565b611893611520565b600160a060020a031633146118a757600080fd5b8060008060405160200180807f6461696c794c696d697400000000000000000000000000000000000000000000815250600a0190506040516020818303038152906040526040518082805190602001908083835b6020831061191a5780518252601f1990920191602091820191016118fb565b51815160001960209485036101000a019081169019919091161790526040805194909201849003909320865285830196909652509284016000209490945550815184815291517fad4123ae17c414d9c6d2fec478b402e6b01856cc250fd01fbfd252fda0089d3c9350918290030190a150565b611995611520565b600160a060020a031633146119a957600080fd5b600081116119b657600080fd5b8060008060405160200180807f676173507269636500000000000000000000000000000000000000000000000081525060080190506040516020818303038152906040526040518082805190602001908083835b60208310611a295780518252601f199092019160209182019101611a0a565b51815160001960209485036101000a019081169019919091161790526040805194909201849003909320865285830196909652509284016000209490945550815184815291517f52264b89e0fceafb26e79fd49ef8a366eb6297483bf4035b027f0c99a7ad512e9350918290030190a150565b611aa4611520565b600160a060020a03163314611ab857600080fd5b611ac061132e565b8110611acb57600080fd5b8060008060405160200180807f6d6178506572547800000000000000000000000000000000000000000000000081525060080190506040516020818303038152906040526040518082805190602001908083836020831061173b5780518252601f19909201916020918201910161171c565b600030600160a060020a031663025313a26040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156114ef57600080fd5b600080600060405160200180807f6d696e506572547800000000000000000000000000000000000000000000000081525060080190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b600080611c0783611402611c026110e0565b610e69565b905080611c1261132e565b10158015611c275750611c23611d1e565b8311155b801561142e5750611c36611b7d565b9092101592915050565b611c48611520565b600160a060020a03163314611c5c57600080fd5b611c64611240565b8110611c6f57600080fd5b8060008060405160200180807f657865637574696f6e4d6178506572547800000000000000000000000000000081525060110190506040516020818303038152906040526040518082805190602001908083836020831061173b5780518252601f19909201916020918201910161171c565b611ce9611520565b600160a060020a03163314611cfd57600080fd5b600160a060020a0381161515611d1257600080fd5b611d1b81612364565b50565b600080600060405160200180807f6d6178506572547800000000000000000000000000000000000000000000000081525060080190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b600080600060405160200180807f676173507269636500000000000000000000000000000000000000000000000081525060080190506040516020818303038152906040526040518082805190602001908083836020831061115d5780518252601f19909201916020918201910161113e565b6000806060600080611e158a6126b9565b1515611e2057600080fd5b85600160a060020a0316638d0680436040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611e5e57600080fd5b505af1158015611e72573d6000803e3d6000fd5b505050506040513d6020811015611e8857600080fd5b50518951909550851115611e9b57600080fd5b611ea48a6126cd565b935084604051908082528060200260200182016040528015611ed0578160200160208202803883390190505b509250600091505b84821015612065576001848a84815181101515611ef157fe5b906020019060200201518a85815181101515611f0957fe5b906020019060200201518a86815181101515611f2157fe5b60209081029091018101516040805160008082528185018084529790975260ff9095168582015260608501939093526080840152905160a0808401949293601f19830193908390039091019190865af1158015611f82573d6000803e3d6000fd5b50505060206040510351905085600160a060020a031663facd743b826040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015611fe957600080fd5b505af1158015611ffd573d6000803e3d6000fd5b505050506040513d602081101561201357600080fd5b5051151561202057600080fd5b61202a8382612892565b1561203457600080fd5b80838381518110151561204357fe5b600160a060020a03909216602092830290910190910152600190910190611ed8565b50505050505050505050565b600080600080612080856126b9565b151561208b57600080fd5b600160a060020a0360148601511693506034850151925060548501519150606885015190509193509193565b60006120c2826113eb565b92915050565b80600460008460405160200180807f72656c617965644d657373616765730000000000000000000000000000000000815250600f0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b6020831061214c5780518252601f19909201916020918201910161212d565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020805460ff1916941515949094179093555050505050565b60006121bb6121a76110e0565b6121b6846114026113fd6110e0565b6128eb565b6121c3610583565b600160a060020a031663a9059cbb84846040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561222557600080fd5b505af1158015612239573d6000803e3d6000fd5b505050506040513d602081101561224f57600080fd5b50519392505050565b6000903b1190565b600160a060020a0381161580159061227c575061227c81612258565b151561228757600080fd5b806002600060405160200180807f6572633230746f6b656e00000000000000000000000000000000000000000000815250600a0190506040516020818303038152906040526040518082805190602001908083835b602083106122fb5780518252601f1990920191602091820191016122dc565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03959095169490941790935550505050565b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e061238d611520565b60408051600160a060020a03928316815291841660208301528051918290030190a1806002600060405160200180807f6f776e65720000000000000000000000000000000000000000000000000000008152506005019050604051602081830303815290604052604051808280519060200190808383602083106122fb5780518252601f1990920191602091820191016122dc565b806004600060405160200180807f6973496e697469616c697a656400000000000000000000000000000000000000815250600d0190506040516020818303038152906040526040518082805190602001908083835b602083106124965780518252601f199092019160209182019101612477565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020805460ff19169415159490941790935550505050565b6000806124ee611b3d565b600160a060020a0316331461250257600080fd5b600160a060020a038316151561251757600080fd5b600160a060020a038416151561256357604051600160a060020a03841690303180156108fc02916000818181858888f1935050505015801561255d573d6000803e3d6000fd5b50612699565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156125c757600080fd5b505af11580156125db573d6000803e3d6000fd5b505050506040513d60208110156125f157600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0386811660048301526024820184905291519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561266257600080fd5b505af1158015612676573d6000803e3d6000fd5b505050506040513d602081101561268c57600080fd5b5051151561269957600080fd5b50505050565b6000828201838110156126ae57fe5b8091505b5092915050565b60006126c36129a8565b8251149050919050565b604080518082018252601a81527f19457468657265756d205369676e6564204d6573736167653a0a000000000000602080830191825283518085018552600381527f313034000000000000000000000000000000000000000000000000000000000081830152935183516000959385938593899391019182918083835b602083106127695780518252601f19909201916020918201910161274a565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106127b15780518252601f199092019160209182019101612792565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106127f95780518252601f1990920191602091820191016127da565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040526040518082805190602001908083835b6020831061285e5780518252601f19909201916020918201910161283f565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120979650505050505050565b6000805b83518110156128e15782600160a060020a031684828151811015156128b757fe5b90602001906020020151600160a060020a031614156128d957600191506126b2565b600101612896565b5060009392505050565b806000808460405160200180807f746f74616c4578656375746564506572446179000000000000000000000000008152506013018281526020019150506040516020818303038152906040526040518082805190602001908083835b602083106129665780518252601f199092019160209182019101612947565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020939093555050505050565b6068905600a165627a7a723058209bcc076dbe02262edfeaff3e152af499b2a9fae194091e3a8af83822216dbad50029