Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
To
|
Amount
|
||
|---|---|---|---|---|---|---|---|
| Exec Script | 1573439 | 2 days ago | 0 ETH | ||||
| Exec Script | 1573366 | 2 days ago | 0 ETH | ||||
| Exec Script | 1566466 | 3 days ago | 0 ETH | ||||
| Exec Script | 1566441 | 3 days ago | 0 ETH | ||||
| Exec Script | 1566398 | 3 days ago | 0 ETH | ||||
| Exec Script | 1566376 | 3 days ago | 0 ETH | ||||
| Exec Script | 1560319 | 4 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554124 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554107 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554101 | 5 days ago | 0 ETH | ||||
| Exec Script | 1554029 | 5 days ago | 0 ETH | ||||
| Exec Script | 1552639 | 5 days ago | 0 ETH | ||||
| Exec Script | 1552565 | 5 days ago | 0 ETH | ||||
| Exec Script | 1546548 | 6 days ago | 0 ETH | ||||
| Exec Script | 1519615 | 10 days ago | 0 ETH | ||||
| Exec Script | 1518816 | 10 days ago | 0 ETH | ||||
| Exec Script | 1518419 | 10 days ago | 0 ETH | ||||
| Exec Script | 1511701 | 11 days ago | 0 ETH | ||||
| Exec Script | 1499218 | 13 days ago | 0 ETH |
Loading...
Loading
Loading...
Loading
Contract Name:
CallsScript
Compiler Version
v0.4.24+commit.e67f0147
Optimization Enabled:
Yes with 200 runs
Other Settings:
constantinople EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.4.24;
// Inspired by https://github.com/reverendus/tx-manager
import "../ScriptHelpers.sol";
import "./BaseEVMScriptExecutor.sol";
contract CallsScript is BaseEVMScriptExecutor {
using ScriptHelpers for bytes;
/* Hardcoded constants to save gas
bytes32 internal constant EXECUTOR_TYPE = keccak256("CALLS_SCRIPT");
*/
bytes32 internal constant EXECUTOR_TYPE = 0x2dc858a00f3e417be1394b87c07158e989ec681ce8cc68a9093680ac1a870302;
string private constant ERROR_BLACKLISTED_CALL = "EVMCALLS_BLACKLISTED_CALL";
string private constant ERROR_INVALID_LENGTH = "EVMCALLS_INVALID_LENGTH";
/* This is manually crafted in assembly
string private constant ERROR_CALL_REVERTED = "EVMCALLS_CALL_REVERTED";
*/
event LogScriptCall(address indexed sender, address indexed src, address indexed dst);
/**
* @notice Executes a number of call scripts
* @param _script [ specId (uint32) ] many calls with this structure ->
* [ to (address: 20 bytes) ] [ calldataLength (uint32: 4 bytes) ] [ calldata (calldataLength bytes) ]
* @param _blacklist Addresses the script cannot call to, or will revert.
* @return Always returns empty byte array
*/
function execScript(bytes _script, bytes, address[] _blacklist) external isInitialized returns (bytes) {
uint256 location = SCRIPT_START_LOCATION; // first 32 bits are spec id
while (location < _script.length) {
// Check there's at least address + calldataLength available
require(_script.length - location >= 0x18, ERROR_INVALID_LENGTH);
address contractAddress = _script.addressAt(location);
// Check address being called is not blacklist
for (uint256 i = 0; i < _blacklist.length; i++) {
require(contractAddress != _blacklist[i], ERROR_BLACKLISTED_CALL);
}
// logged before execution to ensure event ordering in receipt
// if failed entire execution is reverted regardless
emit LogScriptCall(msg.sender, address(this), contractAddress);
uint256 calldataLength = uint256(_script.uint32At(location + 0x14));
uint256 startOffset = location + 0x14 + 0x04;
uint256 calldataStart = _script.locationOf(startOffset);
// compute end of script / next location
location = startOffset + calldataLength;
require(location <= _script.length, ERROR_INVALID_LENGTH);
bool success;
assembly {
success := call(
sub(gas, 5000), // forward gas left - 5000
contractAddress, // address
0, // no value
calldataStart, // calldata start
calldataLength, // calldata length
0, // don't write output
0 // don't write output
)
switch success
case 0 {
let ptr := mload(0x40)
switch returndatasize
case 0 {
// No error data was returned, revert with "EVMCALLS_CALL_REVERTED"
// See remix: doing a `revert("EVMCALLS_CALL_REVERTED")` always results in
// this memory layout
mstore(ptr, 0x08c379a000000000000000000000000000000000000000000000000000000000) // error identifier
mstore(add(ptr, 0x04), 0x0000000000000000000000000000000000000000000000000000000000000020) // starting offset
mstore(add(ptr, 0x24), 0x0000000000000000000000000000000000000000000000000000000000000016) // reason length
mstore(add(ptr, 0x44), 0x45564d43414c4c535f43414c4c5f524556455254454400000000000000000000) // reason
revert(ptr, 100) // 100 = 4 + 3 * 32 (error identifier + 3 words for the ABI encoded error)
}
default {
// Forward the full error data
returndatacopy(ptr, 0, returndatasize)
revert(ptr, returndatasize)
}
}
default { }
}
}
// No need to allocate empty bytes for the return as this can only be called via an delegatecall
// (due to the isInitialized modifier)
}
function executorType() external pure returns (bytes32) {
return EXECUTOR_TYPE;
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "./Petrifiable.sol";
contract Autopetrified is Petrifiable {
constructor() public {
// Immediately petrify base (non-proxy) instances of inherited contracts on deploy.
// This renders them uninitializable (and unusable without a proxy).
petrify();
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "./TimeHelpers.sol";
import "./UnstructuredStorage.sol";
contract Initializable is TimeHelpers {
using UnstructuredStorage for bytes32;
// keccak256("aragonOS.initializable.initializationBlock")
bytes32 internal constant INITIALIZATION_BLOCK_POSITION = 0xebb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e;
string private constant ERROR_ALREADY_INITIALIZED = "INIT_ALREADY_INITIALIZED";
string private constant ERROR_NOT_INITIALIZED = "INIT_NOT_INITIALIZED";
modifier onlyInit {
require(getInitializationBlock() == 0, ERROR_ALREADY_INITIALIZED);
_;
}
modifier isInitialized {
require(hasInitialized(), ERROR_NOT_INITIALIZED);
_;
}
/**
* @return Block number in which the contract was initialized
*/
function getInitializationBlock() public view returns (uint256) {
return INITIALIZATION_BLOCK_POSITION.getStorageUint256();
}
/**
* @return Whether the contract has been initialized by the time of the current block
*/
function hasInitialized() public view returns (bool) {
uint256 initializationBlock = getInitializationBlock();
return initializationBlock != 0 && getBlockNumber() >= initializationBlock;
}
/**
* @dev Function to be called by top level contract after initialization has finished.
*/
function initialized() internal onlyInit {
INITIALIZATION_BLOCK_POSITION.setStorageUint256(getBlockNumber());
}
/**
* @dev Function to be called by top level contract after initialization to enable the contract
* at a future block number rather than immediately.
*/
function initializedAt(uint256 _blockNumber) internal onlyInit {
INITIALIZATION_BLOCK_POSITION.setStorageUint256(_blockNumber);
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "./Initializable.sol";
contract Petrifiable is Initializable {
// Use block UINT256_MAX (which should be never) as the initializable date
uint256 internal constant PETRIFIED_BLOCK = uint256(-1);
function isPetrified() public view returns (bool) {
return getInitializationBlock() == PETRIFIED_BLOCK;
}
/**
* @dev Function to be called by top level contract to prevent being initialized.
* Useful for freezing base contracts when they're used behind proxies.
*/
function petrify() internal onlyInit {
initializedAt(PETRIFIED_BLOCK);
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "./Uint256Helpers.sol";
contract TimeHelpers {
using Uint256Helpers for uint256;
/**
* @dev Returns the current block number.
* Using a function rather than `block.number` allows us to easily mock the block number in
* tests.
*/
function getBlockNumber() internal view returns (uint256) {
return block.number;
}
/**
* @dev Returns the current block number, converted to uint64.
* Using a function rather than `block.number` allows us to easily mock the block number in
* tests.
*/
function getBlockNumber64() internal view returns (uint64) {
return getBlockNumber().toUint64();
}
/**
* @dev Returns the current timestamp.
* Using a function rather than `block.timestamp` allows us to easily mock it in
* tests.
*/
function getTimestamp() internal view returns (uint256) {
return block.timestamp; // solium-disable-line security/no-block-members
}
/**
* @dev Returns the current timestamp, converted to uint64.
* Using a function rather than `block.timestamp` allows us to easily mock it in
* tests.
*/
function getTimestamp64() internal view returns (uint64) {
return getTimestamp().toUint64();
}
}pragma solidity ^0.4.24;
library Uint256Helpers {
uint256 private constant MAX_UINT64 = uint64(-1);
string private constant ERROR_NUMBER_TOO_BIG = "UINT64_NUMBER_TOO_BIG";
function toUint64(uint256 a) internal pure returns (uint64) {
require(a <= MAX_UINT64, ERROR_NUMBER_TOO_BIG);
return uint64(a);
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
library UnstructuredStorage {
function getStorageBool(bytes32 position) internal view returns (bool data) {
assembly { data := sload(position) }
}
function getStorageAddress(bytes32 position) internal view returns (address data) {
assembly { data := sload(position) }
}
function getStorageBytes32(bytes32 position) internal view returns (bytes32 data) {
assembly { data := sload(position) }
}
function getStorageUint256(bytes32 position) internal view returns (uint256 data) {
assembly { data := sload(position) }
}
function setStorageBool(bytes32 position, bool data) internal {
assembly { sstore(position, data) }
}
function setStorageAddress(bytes32 position, address data) internal {
assembly { sstore(position, data) }
}
function setStorageBytes32(bytes32 position, bytes32 data) internal {
assembly { sstore(position, data) }
}
function setStorageUint256(bytes32 position, uint256 data) internal {
assembly { sstore(position, data) }
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "../../common/Autopetrified.sol";
import "../IEVMScriptExecutor.sol";
contract BaseEVMScriptExecutor is IEVMScriptExecutor, Autopetrified {
uint256 internal constant SCRIPT_START_LOCATION = 4;
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
interface IEVMScriptExecutor {
function execScript(bytes script, bytes input, address[] blacklist) external returns (bytes);
function executorType() external pure returns (bytes32);
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
library ScriptHelpers {
function getSpecId(bytes _script) internal pure returns (uint32) {
return uint32At(_script, 0);
}
function uint256At(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := mload(add(_data, add(0x20, _location)))
}
}
function addressAt(bytes _data, uint256 _location) internal pure returns (address result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000),
0x1000000000000000000000000)
}
}
function uint32At(bytes _data, uint256 _location) internal pure returns (uint32 result) {
uint256 word = uint256At(_data, _location);
assembly {
result := div(and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000),
0x100000000000000000000000000000000000000000000000000000000)
}
}
function locationOf(bytes _data, uint256 _location) internal pure returns (uint256 result) {
assembly {
result := add(_data, add(0x20, _location))
}
}
function toBytes(bytes4 _sig) internal pure returns (bytes) {
bytes memory payload = new bytes(4);
assembly { mstore(add(payload, 0x20), _sig) }
return payload;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "constantinople",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract ABI
API[{"constant":true,"inputs":[],"name":"hasInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_script","type":"bytes"},{"name":"","type":"bytes"},{"name":"_blacklist","type":"address[]"}],"name":"execScript","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"executorType","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":true,"name":"src","type":"address"},{"indexed":true,"name":"dst","type":"address"}],"name":"LogScriptCall","type":"event"}]Contract Creation Code
608060405261001261001760201b60201c565b610219565b61002561011160201b60201c565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a45440000000000000000602082015290156100fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156100c25781810151838201526020016100aa565b50505050905090810190601f1680156100ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5061010f60001961014060201b60201c565b565b600061013b6000805160206109b083398151915260001b6000191661021160201b61074c1760201c565b905090565b61014e61011160201b60201c565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a45440000000000000000602082015290156101ea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382528381815181526020019150805190602001908083836000838110156100c25781810151838201526020016100aa565b5061020e6000805160206109b083398151915282610215602090811b61075817901c565b50565b5490565b9055565b610788806102286000396000f3006080604052600436106100505760003560e01c63ffffffff1680630803fac014610055578063279cea351461007e5780638333d9b21461012b5780638b3dd74914610152578063de4796ed14610167575b600080fd5b34801561006157600080fd5b5061006a61017c565b604080519115158252519081900360200190f35b34801561008a57600080fd5b506100b660246004803582810192908201359181358083019290820135916044359182019101356101a5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013757600080fd5b5061014061064d565b60408051918252519081900360200190f35b34801561015e57600080fd5b50610140610671565b34801561017357600080fd5b5061006a6106a1565b600080610187610671565b9050801580159061019f57508061019c6106b4565b10155b91505090565b606060008060008060008060006101ba61017c565b60408051808201909152601481527f494e49545f4e4f545f494e495449414c495a4544000000000000000000000000602082015290151561027c5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610241578181015183820152602001610229565b50505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600496505b8c87101561063c5760408051808201909152601781527f45564d43414c4c535f494e56414c49445f4c454e47544800000000000000000060208201526018888f0310156103145760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015610241578181015183820152602001610229565b50610358878f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843750949594505063ffffffff6106b81692505050565b9550600094505b888510156104535789898681811061037357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156040805190810160405280601981526020017f45564d43414c4c535f424c41434b4c49535445445f43414c4c000000000000008152509015156104475760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015610241578181015183820152602001610229565b5060019094019361035f565b60405173ffffffffffffffffffffffffffffffffffffffff871690309033907f9dcff9d94fbfdb4622d11edb383005f95e78efb446c72d92f8e615c6025c470390600090a46104de876014018f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843750949594505063ffffffff6106ed1692505050565b63ffffffff169350866014016004019250610532838f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843750949594505063ffffffff6107451692505050565b60408051808201909152601781527f45564d43414c4c535f494e56414c49445f4c454e475448000000000000000000602082015284860198509092508d8811156105c15760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015610241578181015183820152602001610229565b50600080858460008a6113885a03f190508080156105de57610636565b6040513d80156105f1573d6000833e3d82fd5b60e560020a62461bcd02825260206004830152601660248301527f45564d43414c4c535f43414c4c5f5245564552544544000000000000000000006044830152606482fd5b50610282565b505050505050509695505050505050565b7f2dc858a00f3e417be1394b87c07158e989ec681ce8cc68a9093680ac1a87030290565b600061069c7febb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e61074c565b905090565b60006000196106ae610671565b14905090565b4390565b6000806106c58484610750565b6c010000000000000000000000006bffffffffffffffffffffffff1990911604949350505050565b6000806106fa8484610750565b7c01000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000090911604949350505050565b0160200190565b5490565b016020015190565b90555600a165627a7a723058208f73319ac016da9c3cfe2edf91407f310f54a1d3f644607b550d604524a39bc70029ebb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e
Deployed Bytecode
0x6080604052600436106100505760003560e01c63ffffffff1680630803fac014610055578063279cea351461007e5780638333d9b21461012b5780638b3dd74914610152578063de4796ed14610167575b600080fd5b34801561006157600080fd5b5061006a61017c565b604080519115158252519081900360200190f35b34801561008a57600080fd5b506100b660246004803582810192908201359181358083019290820135916044359182019101356101a5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561013757600080fd5b5061014061064d565b60408051918252519081900360200190f35b34801561015e57600080fd5b50610140610671565b34801561017357600080fd5b5061006a6106a1565b600080610187610671565b9050801580159061019f57508061019c6106b4565b10155b91505090565b606060008060008060008060006101ba61017c565b60408051808201909152601481527f494e49545f4e4f545f494e495449414c495a4544000000000000000000000000602082015290151561027c5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610241578181015183820152602001610229565b50505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600496505b8c87101561063c5760408051808201909152601781527f45564d43414c4c535f494e56414c49445f4c454e47544800000000000000000060208201526018888f0310156103145760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015610241578181015183820152602001610229565b50610358878f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843750949594505063ffffffff6106b81692505050565b9550600094505b888510156104535789898681811061037357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156040805190810160405280601981526020017f45564d43414c4c535f424c41434b4c49535445445f43414c4c000000000000008152509015156104475760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015610241578181015183820152602001610229565b5060019094019361035f565b60405173ffffffffffffffffffffffffffffffffffffffff871690309033907f9dcff9d94fbfdb4622d11edb383005f95e78efb446c72d92f8e615c6025c470390600090a46104de876014018f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843750949594505063ffffffff6106ed1692505050565b63ffffffff169350866014016004019250610532838f8f8080601f01602080910402602001604051908101604052809392919081815260200183838082843750949594505063ffffffff6107451692505050565b60408051808201909152601781527f45564d43414c4c535f494e56414c49445f4c454e475448000000000000000000602082015284860198509092508d8811156105c15760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015610241578181015183820152602001610229565b50600080858460008a6113885a03f190508080156105de57610636565b6040513d80156105f1573d6000833e3d82fd5b60e560020a62461bcd02825260206004830152601660248301527f45564d43414c4c535f43414c4c5f5245564552544544000000000000000000006044830152606482fd5b50610282565b505050505050509695505050505050565b7f2dc858a00f3e417be1394b87c07158e989ec681ce8cc68a9093680ac1a87030290565b600061069c7febb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e61074c565b905090565b60006000196106ae610671565b14905090565b4390565b6000806106c58484610750565b6c010000000000000000000000006bffffffffffffffffffffffff1990911604949350505050565b6000806106fa8484610750565b7c01000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000090911604949350505050565b0160200190565b5490565b016020015190565b90555600a165627a7a723058208f73319ac016da9c3cfe2edf91407f310f54a1d3f644607b550d604524a39bc70029
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.