Overview
ETH Balance
More Info
ContractCreator
Multichain Info
Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| New App Proxy | 31905 | 769 days ago | IN | 0 ETH | 0.00153741 |
Latest 1 internal transaction
| Parent Transaction Hash | Method | Block |
From
|
To
|
Amount
|
||
|---|---|---|---|---|---|---|---|
| 0x60806040 | 31905 | 769 days ago | Contract Creation | 0 ETH |
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.4.24;
import "./IKernel.sol";
import "./KernelConstants.sol";
import "./KernelStorage.sol";
import "../acl/IACL.sol";
import "../acl/ACLSyntaxSugar.sol";
import "../common/ConversionHelpers.sol";
import "../common/IsContract.sol";
import "../common/Petrifiable.sol";
import "../common/VaultRecoverable.sol";
import "../factory/AppProxyFactory.sol";
import "../lib/misc/ERCProxy.sol";
// solium-disable-next-line max-len
contract Kernel is IKernel, KernelStorage, KernelAppIds, KernelNamespaceConstants, Petrifiable, IsContract, VaultRecoverable, AppProxyFactory, ACLSyntaxSugar {
/* Hardcoded constants to save gas
bytes32 public constant APP_MANAGER_ROLE = keccak256("APP_MANAGER_ROLE");
*/
bytes32 public constant APP_MANAGER_ROLE = 0xb6d92708f3d4817afc106147d969e229ced5c46e65e0a5002a0d391287762bd0;
string private constant ERROR_APP_NOT_CONTRACT = "KERNEL_APP_NOT_CONTRACT";
string private constant ERROR_INVALID_APP_CHANGE = "KERNEL_INVALID_APP_CHANGE";
string private constant ERROR_AUTH_FAILED = "KERNEL_AUTH_FAILED";
/**
* @dev Constructor that allows the deployer to choose if the base instance should be petrified immediately.
* @param _shouldPetrify Immediately petrify this instance so that it can never be initialized
*/
constructor(bool _shouldPetrify) public {
if (_shouldPetrify) {
petrify();
}
}
/**
* @dev Initialize can only be called once. It saves the block number in which it was initialized.
* @notice Initialize this kernel instance along with its ACL and set `_permissionsCreator` as the entity that can create other permissions
* @param _baseAcl Address of base ACL app
* @param _permissionsCreator Entity that will be given permission over createPermission
*/
function initialize(IACL _baseAcl, address _permissionsCreator) public onlyInit {
initialized();
// Set ACL base
_setApp(KERNEL_APP_BASES_NAMESPACE, KERNEL_DEFAULT_ACL_APP_ID, _baseAcl);
// Create ACL instance and attach it as the default ACL app
IACL acl = IACL(newAppProxy(this, KERNEL_DEFAULT_ACL_APP_ID));
acl.initialize(_permissionsCreator);
_setApp(KERNEL_APP_ADDR_NAMESPACE, KERNEL_DEFAULT_ACL_APP_ID, acl);
recoveryVaultAppId = KERNEL_DEFAULT_VAULT_APP_ID;
}
/**
* @dev Create a new instance of an app linked to this kernel
* @notice Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @return AppProxy instance
*/
function newAppInstance(bytes32 _appId, address _appBase)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
return newAppInstance(_appId, _appBase, new bytes(0), false);
}
/**
* @dev Create a new instance of an app linked to this kernel and set its base
* implementation if it was not already set
* @notice Create a new upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @param _initializePayload Payload for call made by the proxy during its construction to initialize
* @param _setDefault Whether the app proxy app is the default one.
* Useful when the Kernel needs to know of an instance of a particular app,
* like Vault for escape hatch mechanism.
* @return AppProxy instance
*/
function newAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
_setAppIfNew(KERNEL_APP_BASES_NAMESPACE, _appId, _appBase);
appProxy = newAppProxy(this, _appId, _initializePayload);
// By calling setApp directly and not the internal functions, we make sure the params are checked
// and it will only succeed if sender has permissions to set something to the namespace.
if (_setDefault) {
setApp(KERNEL_APP_ADDR_NAMESPACE, _appId, appProxy);
}
}
/**
* @dev Create a new pinned instance of an app linked to this kernel
* @notice Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`.
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @return AppProxy instance
*/
function newPinnedAppInstance(bytes32 _appId, address _appBase)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
return newPinnedAppInstance(_appId, _appBase, new bytes(0), false);
}
/**
* @dev Create a new pinned instance of an app linked to this kernel and set
* its base implementation if it was not already set
* @notice Create a new non-upgradeable instance of `_appId` app linked to the Kernel, setting its code to `_appBase`. `_setDefault ? 'Also sets it as the default app instance.':''`
* @param _appId Identifier for app
* @param _appBase Address of the app's base implementation
* @param _initializePayload Payload for call made by the proxy during its construction to initialize
* @param _setDefault Whether the app proxy app is the default one.
* Useful when the Kernel needs to know of an instance of a particular app,
* like Vault for escape hatch mechanism.
* @return AppProxy instance
*/
function newPinnedAppInstance(bytes32 _appId, address _appBase, bytes _initializePayload, bool _setDefault)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_BASES_NAMESPACE, _appId))
returns (ERCProxy appProxy)
{
_setAppIfNew(KERNEL_APP_BASES_NAMESPACE, _appId, _appBase);
appProxy = newAppProxyPinned(this, _appId, _initializePayload);
// By calling setApp directly and not the internal functions, we make sure the params are checked
// and it will only succeed if sender has permissions to set something to the namespace.
if (_setDefault) {
setApp(KERNEL_APP_ADDR_NAMESPACE, _appId, appProxy);
}
}
/**
* @dev Set the resolving address of an app instance or base implementation
* @notice Set the resolving address of `_appId` in namespace `_namespace` to `_app`
* @param _namespace App namespace to use
* @param _appId Identifier for app
* @param _app Address of the app instance or base implementation
* @return ID of app
*/
function setApp(bytes32 _namespace, bytes32 _appId, address _app)
public
auth(APP_MANAGER_ROLE, arr(_namespace, _appId))
{
_setApp(_namespace, _appId, _app);
}
/**
* @dev Set the default vault id for the escape hatch mechanism
* @param _recoveryVaultAppId Identifier of the recovery vault app
*/
function setRecoveryVaultAppId(bytes32 _recoveryVaultAppId)
public
auth(APP_MANAGER_ROLE, arr(KERNEL_APP_ADDR_NAMESPACE, _recoveryVaultAppId))
{
recoveryVaultAppId = _recoveryVaultAppId;
}
// External access to default app id and namespace constants to mimic default getters for constants
/* solium-disable function-order, mixedcase */
function CORE_NAMESPACE() external pure returns (bytes32) { return KERNEL_CORE_NAMESPACE; }
function APP_BASES_NAMESPACE() external pure returns (bytes32) { return KERNEL_APP_BASES_NAMESPACE; }
function APP_ADDR_NAMESPACE() external pure returns (bytes32) { return KERNEL_APP_ADDR_NAMESPACE; }
function KERNEL_APP_ID() external pure returns (bytes32) { return KERNEL_CORE_APP_ID; }
function DEFAULT_ACL_APP_ID() external pure returns (bytes32) { return KERNEL_DEFAULT_ACL_APP_ID; }
/* solium-enable function-order, mixedcase */
/**
* @dev Get the address of an app instance or base implementation
* @param _namespace App namespace to use
* @param _appId Identifier for app
* @return Address of the app
*/
function getApp(bytes32 _namespace, bytes32 _appId) public view returns (address) {
return apps[_namespace][_appId];
}
/**
* @dev Get the address of the recovery Vault instance (to recover funds)
* @return Address of the Vault
*/
function getRecoveryVault() public view returns (address) {
return apps[KERNEL_APP_ADDR_NAMESPACE][recoveryVaultAppId];
}
/**
* @dev Get the installed ACL app
* @return ACL app
*/
function acl() public view returns (IACL) {
return IACL(getApp(KERNEL_APP_ADDR_NAMESPACE, KERNEL_DEFAULT_ACL_APP_ID));
}
/**
* @dev Function called by apps to check ACL on kernel or to check permission status
* @param _who Sender of the original call
* @param _where Address of the app
* @param _what Identifier for a group of actions in app
* @param _how Extra data for ACL auth
* @return Boolean indicating whether the ACL allows the role or not.
* Always returns false if the kernel hasn't been initialized yet.
*/
function hasPermission(address _who, address _where, bytes32 _what, bytes _how) public view returns (bool) {
IACL defaultAcl = acl();
return address(defaultAcl) != address(0) && // Poor man's initialization check (saves gas)
defaultAcl.hasPermission(_who, _where, _what, _how);
}
function _setApp(bytes32 _namespace, bytes32 _appId, address _app) internal {
require(isContract(_app), ERROR_APP_NOT_CONTRACT);
apps[_namespace][_appId] = _app;
emit SetApp(_namespace, _appId, _app);
}
function _setAppIfNew(bytes32 _namespace, bytes32 _appId, address _app) internal {
address app = getApp(_namespace, _appId);
if (app != address(0)) {
// The only way to set an app is if it passes the isContract check, so no need to check it again
require(app == _app, ERROR_INVALID_APP_CHANGE);
} else {
_setApp(_namespace, _appId, _app);
}
}
modifier auth(bytes32 _role, uint256[] memory _params) {
require(
hasPermission(msg.sender, address(this), _role, ConversionHelpers.dangerouslyCastUintArrayToBytes(_params)),
ERROR_AUTH_FAILED
);
_;
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
contract ACLSyntaxSugar {
function arr() internal pure returns (uint256[]) {
return new uint256[](0);
}
function arr(bytes32 _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(bytes32 _a, bytes32 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a) internal pure returns (uint256[] r) {
return arr(uint256(_a));
}
function arr(address _a, address _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), _b, _c);
}
function arr(address _a, uint256 _b, uint256 _c, uint256 _d) internal pure returns (uint256[] r) {
return arr(uint256(_a), _b, _c, _d);
}
function arr(address _a, uint256 _b) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b));
}
function arr(address _a, address _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), _c, _d, _e);
}
function arr(address _a, address _b, address _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(address _a, address _b, uint256 _c) internal pure returns (uint256[] r) {
return arr(uint256(_a), uint256(_b), uint256(_c));
}
function arr(uint256 _a) internal pure returns (uint256[] r) {
r = new uint256[](1);
r[0] = _a;
}
function arr(uint256 _a, uint256 _b) internal pure returns (uint256[] r) {
r = new uint256[](2);
r[0] = _a;
r[1] = _b;
}
function arr(uint256 _a, uint256 _b, uint256 _c) internal pure returns (uint256[] r) {
r = new uint256[](3);
r[0] = _a;
r[1] = _b;
r[2] = _c;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d) internal pure returns (uint256[] r) {
r = new uint256[](4);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
}
function arr(uint256 _a, uint256 _b, uint256 _c, uint256 _d, uint256 _e) internal pure returns (uint256[] r) {
r = new uint256[](5);
r[0] = _a;
r[1] = _b;
r[2] = _c;
r[3] = _d;
r[4] = _e;
}
}
contract ACLHelpers {
function decodeParamOp(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 30));
}
function decodeParamId(uint256 _x) internal pure returns (uint8 b) {
return uint8(_x >> (8 * 31));
}
function decodeParamsList(uint256 _x) internal pure returns (uint32 a, uint32 b, uint32 c) {
a = uint32(_x);
b = uint32(_x >> (8 * 4));
c = uint32(_x >> (8 * 8));
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
interface IACL {
function initialize(address permissionsCreator) external;
// TODO: this should be external
// See https://github.com/ethereum/solidity/issues/4832
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
}pragma solidity 0.4.24;
import "./AppStorage.sol";
import "../common/DepositableDelegateProxy.sol";
import "../kernel/KernelConstants.sol";
import "../kernel/IKernel.sol";
contract AppProxyBase is AppStorage, DepositableDelegateProxy, KernelNamespaceConstants {
/**
* @dev Initialize AppProxy
* @param _kernel Reference to organization kernel for the app
* @param _appId Identifier for app
* @param _initializePayload Payload for call to be made after setup to initialize
*/
constructor(IKernel _kernel, bytes32 _appId, bytes _initializePayload) public {
setKernel(_kernel);
setAppId(_appId);
// Implicit check that kernel is actually a Kernel
// The EVM doesn't actually provide a way for us to make sure, but we can force a revert to
// occur if the kernel is set to 0x0 or a non-code address when we try to call a method on
// it.
address appCode = getAppBase(_appId);
// If initialize payload is provided, it will be executed
if (_initializePayload.length > 0) {
require(isContract(appCode));
// Cannot make delegatecall as a delegateproxy.delegatedFwd as it
// returns ending execution context and halts contract deployment
require(appCode.delegatecall(_initializePayload));
}
}
function getAppBase(bytes32 _appId) internal view returns (address) {
return kernel().getApp(KERNEL_APP_BASES_NAMESPACE, _appId);
}
}pragma solidity 0.4.24;
import "../common/UnstructuredStorage.sol";
import "../common/IsContract.sol";
import "./AppProxyBase.sol";
contract AppProxyPinned is IsContract, AppProxyBase {
using UnstructuredStorage for bytes32;
// keccak256("aragonOS.appStorage.pinnedCode")
bytes32 internal constant PINNED_CODE_POSITION = 0xdee64df20d65e53d7f51cb6ab6d921a0a6a638a91e942e1d8d02df28e31c038e;
/**
* @dev Initialize AppProxyPinned (makes it an un-upgradeable Aragon app)
* @param _kernel Reference to organization kernel for the app
* @param _appId Identifier for app
* @param _initializePayload Payload for call to be made after setup to initialize
*/
constructor(IKernel _kernel, bytes32 _appId, bytes _initializePayload)
AppProxyBase(_kernel, _appId, _initializePayload)
public // solium-disable-line visibility-first
{
setPinnedCode(getAppBase(_appId));
require(isContract(pinnedCode()));
}
/**
* @dev ERC897, the address the proxy would delegate calls to
*/
function implementation() public view returns (address) {
return pinnedCode();
}
/**
* @dev ERC897, whether it is a forwarding (1) or an upgradeable (2) proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
return FORWARDING;
}
function setPinnedCode(address _pinnedCode) internal {
PINNED_CODE_POSITION.setStorageAddress(_pinnedCode);
}
function pinnedCode() internal view returns (address) {
return PINNED_CODE_POSITION.getStorageAddress();
}
}pragma solidity 0.4.24;
import "./AppProxyBase.sol";
contract AppProxyUpgradeable is AppProxyBase {
/**
* @dev Initialize AppProxyUpgradeable (makes it an upgradeable Aragon app)
* @param _kernel Reference to organization kernel for the app
* @param _appId Identifier for app
* @param _initializePayload Payload for call to be made after setup to initialize
*/
constructor(IKernel _kernel, bytes32 _appId, bytes _initializePayload)
AppProxyBase(_kernel, _appId, _initializePayload)
public // solium-disable-line visibility-first
{
// solium-disable-previous-line no-empty-blocks
}
/**
* @dev ERC897, the address the proxy would delegate calls to
*/
function implementation() public view returns (address) {
return getAppBase(appId());
}
/**
* @dev ERC897, whether it is a forwarding (1) or an upgradeable (2) proxy
*/
function proxyType() public pure returns (uint256 proxyTypeId) {
return UPGRADEABLE;
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "../common/UnstructuredStorage.sol";
import "../kernel/IKernel.sol";
contract AppStorage {
using UnstructuredStorage for bytes32;
/* Hardcoded constants to save gas
bytes32 internal constant KERNEL_POSITION = keccak256("aragonOS.appStorage.kernel");
bytes32 internal constant APP_ID_POSITION = keccak256("aragonOS.appStorage.appId");
*/
bytes32 internal constant KERNEL_POSITION = 0x4172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137b;
bytes32 internal constant APP_ID_POSITION = 0xd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b;
function kernel() public view returns (IKernel) {
return IKernel(KERNEL_POSITION.getStorageAddress());
}
function appId() public view returns (bytes32) {
return APP_ID_POSITION.getStorageBytes32();
}
function setKernel(IKernel _kernel) internal {
KERNEL_POSITION.setStorageAddress(address(_kernel));
}
function setAppId(bytes32 _appId) internal {
APP_ID_POSITION.setStorageBytes32(_appId);
}
}pragma solidity ^0.4.24;
library ConversionHelpers {
string private constant ERROR_IMPROPER_LENGTH = "CONVERSION_IMPROPER_LENGTH";
function dangerouslyCastUintArrayToBytes(uint256[] memory _input) internal pure returns (bytes memory output) {
// Force cast the uint256[] into a bytes array, by overwriting its length
// Note that the bytes array doesn't need to be initialized as we immediately overwrite it
// with the input and a new length. The input becomes invalid from this point forward.
uint256 byteLength = _input.length * 32;
assembly {
output := _input
mstore(output, byteLength)
}
}
function dangerouslyCastBytesToUintArray(bytes memory _input) internal pure returns (uint256[] memory output) {
// Force cast the bytes array into a uint256[], by overwriting its length
// Note that the uint256[] doesn't need to be initialized as we immediately overwrite it
// with the input and a new length. The input becomes invalid from this point forward.
uint256 intsLength = _input.length / 32;
require(_input.length == intsLength * 32, ERROR_IMPROPER_LENGTH);
assembly {
output := _input
mstore(output, intsLength)
}
}
}pragma solidity 0.4.24;
import "../common/IsContract.sol";
import "../lib/misc/ERCProxy.sol";
contract DelegateProxy is ERCProxy, IsContract {
uint256 internal constant FWD_GAS_LIMIT = 10000;
/**
* @dev Performs a delegatecall and returns whatever the delegatecall returned (entire context execution will return!)
* @param _dst Destination address to perform the delegatecall
* @param _calldata Calldata for the delegatecall
*/
function delegatedFwd(address _dst, bytes _calldata) internal {
require(isContract(_dst));
uint256 fwdGasLimit = FWD_GAS_LIMIT;
assembly {
let result := delegatecall(sub(gas, fwdGasLimit), _dst, add(_calldata, 0x20), mload(_calldata), 0, 0)
let size := returndatasize
let ptr := mload(0x40)
returndatacopy(ptr, 0, size)
// revert instead of invalid() bc if the underlying call failed with invalid() it already wasted gas.
// if the call returned error data, forward it
switch result case 0 { revert(ptr, size) }
default { return(ptr, size) }
}
}
}pragma solidity 0.4.24;
import "./DelegateProxy.sol";
import "./DepositableStorage.sol";
contract DepositableDelegateProxy is DepositableStorage, DelegateProxy {
event ProxyDeposit(address sender, uint256 value);
function () external payable {
uint256 forwardGasThreshold = FWD_GAS_LIMIT;
bytes32 isDepositablePosition = DEPOSITABLE_POSITION;
// Optimized assembly implementation to prevent EIP-1884 from breaking deposits, reference code in Solidity:
// https://github.com/aragon/aragonOS/blob/v4.2.1/contracts/common/DepositableDelegateProxy.sol#L10-L20
assembly {
// Continue only if the gas left is lower than the threshold for forwarding to the implementation code,
// otherwise continue outside of the assembly block.
if lt(gas, forwardGasThreshold) {
// Only accept the deposit and emit an event if all of the following are true:
// the proxy accepts deposits (isDepositable), msg.data.length == 0, and msg.value > 0
if and(and(sload(isDepositablePosition), iszero(calldatasize)), gt(callvalue, 0)) {
// Equivalent Solidity code for emitting the event:
// emit ProxyDeposit(msg.sender, msg.value);
let logData := mload(0x40) // free memory pointer
mstore(logData, caller) // add 'msg.sender' to the log data (first event param)
mstore(add(logData, 0x20), callvalue) // add 'msg.value' to the log data (second event param)
// Emit an event with one topic to identify the event: keccak256('ProxyDeposit(address,uint256)') = 0x15ee...dee1
log1(logData, 0x40, 0x15eeaa57c7bd188c1388020bcadc2c436ec60d647d36ef5b9eb3c742217ddee1)
stop() // Stop. Exits execution context
}
// If any of above checks failed, revert the execution (if ETH was sent, it is returned to the sender)
revert(0, 0)
}
}
address target = implementation();
delegatedFwd(target, msg.data);
}
}pragma solidity 0.4.24;
import "./UnstructuredStorage.sol";
contract DepositableStorage {
using UnstructuredStorage for bytes32;
// keccak256("aragonOS.depositableStorage.depositable")
bytes32 internal constant DEPOSITABLE_POSITION = 0x665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea;
function isDepositable() public view returns (bool) {
return DEPOSITABLE_POSITION.getStorageBool();
}
function setDepositable(bool _depositable) internal {
DEPOSITABLE_POSITION.setStorageBool(_depositable);
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
// aragonOS and aragon-apps rely on address(0) to denote native ETH, in
// contracts where both tokens and ETH are accepted
contract EtherTokenConstant {
address internal constant ETH = address(0);
}/*
* 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;
contract IsContract {
/*
* NOTE: this should NEVER be used for authentication
* (see pitfalls: https://github.com/fergarrui/ethereum-security/tree/master/contracts/extcodesize).
*
* This is only intended to be used as a sanity check that an address is actually a contract,
* RATHER THAN an address not being a contract.
*/
function isContract(address _target) internal view returns (bool) {
if (_target == address(0)) {
return false;
}
uint256 size;
assembly { size := extcodesize(_target) }
return size > 0;
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
interface IVaultRecoverable {
event RecoverToVault(address indexed vault, address indexed token, uint256 amount);
function transferToVault(address token) external;
function allowRecoverability(address token) external view returns (bool);
function getRecoveryVault() external view returns (address);
}/*
* 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);
}
}// Inspired by AdEx (https://github.com/AdExNetwork/adex-protocol-eth/blob/b9df617829661a7518ee10f4cb6c4108659dd6d5/contracts/libs/SafeERC20.sol)
// and 0x (https://github.com/0xProject/0x-monorepo/blob/737d1dc54d72872e24abce5a1dbe1b66d35fa21a/contracts/protocol/contracts/protocol/AssetProxy/ERC20Proxy.sol#L143)
pragma solidity ^0.4.24;
import "../lib/token/ERC20.sol";
library SafeERC20 {
// Before 0.5, solidity has a mismatch between `address.transfer()` and `token.transfer()`:
// https://github.com/ethereum/solidity/issues/3544
bytes4 private constant TRANSFER_SELECTOR = 0xa9059cbb;
string private constant ERROR_TOKEN_BALANCE_REVERTED = "SAFE_ERC_20_BALANCE_REVERTED";
string private constant ERROR_TOKEN_ALLOWANCE_REVERTED = "SAFE_ERC_20_ALLOWANCE_REVERTED";
function invokeAndCheckSuccess(address _addr, bytes memory _calldata)
private
returns (bool)
{
bool ret;
assembly {
let ptr := mload(0x40) // free memory pointer
let success := call(
gas, // forward all gas
_addr, // address
0, // no value
add(_calldata, 0x20), // calldata start
mload(_calldata), // calldata length
ptr, // write output over free memory
0x20 // uint256 return
)
if gt(success, 0) {
// Check number of bytes returned from last function call
switch returndatasize
// No bytes returned: assume success
case 0 {
ret := 1
}
// 32 bytes returned: check if non-zero
case 0x20 {
// Only return success if returned data was true
// Already have output in ptr
ret := eq(mload(ptr), 1)
}
// Not sure what was returned: don't mark as success
default { }
}
}
return ret;
}
function staticInvoke(address _addr, bytes memory _calldata)
private
view
returns (bool, uint256)
{
bool success;
uint256 ret;
assembly {
let ptr := mload(0x40) // free memory pointer
success := staticcall(
gas, // forward all gas
_addr, // address
add(_calldata, 0x20), // calldata start
mload(_calldata), // calldata length
ptr, // write output over free memory
0x20 // uint256 return
)
if gt(success, 0) {
ret := mload(ptr)
}
}
return (success, ret);
}
/**
* @dev Same as a standards-compliant ERC20.transfer() that never reverts (returns false).
* Note that this makes an external call to the token.
*/
function safeTransfer(ERC20 _token, address _to, uint256 _amount) internal returns (bool) {
bytes memory transferCallData = abi.encodeWithSelector(
TRANSFER_SELECTOR,
_to,
_amount
);
return invokeAndCheckSuccess(_token, transferCallData);
}
/**
* @dev Same as a standards-compliant ERC20.transferFrom() that never reverts (returns false).
* Note that this makes an external call to the token.
*/
function safeTransferFrom(ERC20 _token, address _from, address _to, uint256 _amount) internal returns (bool) {
bytes memory transferFromCallData = abi.encodeWithSelector(
_token.transferFrom.selector,
_from,
_to,
_amount
);
return invokeAndCheckSuccess(_token, transferFromCallData);
}
/**
* @dev Same as a standards-compliant ERC20.approve() that never reverts (returns false).
* Note that this makes an external call to the token.
*/
function safeApprove(ERC20 _token, address _spender, uint256 _amount) internal returns (bool) {
bytes memory approveCallData = abi.encodeWithSelector(
_token.approve.selector,
_spender,
_amount
);
return invokeAndCheckSuccess(_token, approveCallData);
}
/**
* @dev Static call into ERC20.balanceOf().
* Reverts if the call fails for some reason (should never fail).
*/
function staticBalanceOf(ERC20 _token, address _owner) internal view returns (uint256) {
bytes memory balanceOfCallData = abi.encodeWithSelector(
_token.balanceOf.selector,
_owner
);
(bool success, uint256 tokenBalance) = staticInvoke(_token, balanceOfCallData);
require(success, ERROR_TOKEN_BALANCE_REVERTED);
return tokenBalance;
}
/**
* @dev Static call into ERC20.allowance().
* Reverts if the call fails for some reason (should never fail).
*/
function staticAllowance(ERC20 _token, address _owner, address _spender) internal view returns (uint256) {
bytes memory allowanceCallData = abi.encodeWithSelector(
_token.allowance.selector,
_owner,
_spender
);
(bool success, uint256 allowance) = staticInvoke(_token, allowanceCallData);
require(success, ERROR_TOKEN_ALLOWANCE_REVERTED);
return allowance;
}
/**
* @dev Static call into ERC20.totalSupply().
* Reverts if the call fails for some reason (should never fail).
*/
function staticTotalSupply(ERC20 _token) internal view returns (uint256) {
bytes memory totalSupplyCallData = abi.encodeWithSelector(_token.totalSupply.selector);
(bool success, uint256 totalSupply) = staticInvoke(_token, totalSupplyCallData);
require(success, ERROR_TOKEN_ALLOWANCE_REVERTED);
return totalSupply;
}
}/*
* 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 "../lib/token/ERC20.sol";
import "./EtherTokenConstant.sol";
import "./IsContract.sol";
import "./IVaultRecoverable.sol";
import "./SafeERC20.sol";
contract VaultRecoverable is IVaultRecoverable, EtherTokenConstant, IsContract {
using SafeERC20 for ERC20;
string private constant ERROR_DISALLOWED = "RECOVER_DISALLOWED";
string private constant ERROR_VAULT_NOT_CONTRACT = "RECOVER_VAULT_NOT_CONTRACT";
string private constant ERROR_TOKEN_TRANSFER_FAILED = "RECOVER_TOKEN_TRANSFER_FAILED";
/**
* @notice Send funds to recovery Vault. This contract should never receive funds,
* but in case it does, this function allows one to recover them.
* @param _token Token balance to be sent to recovery vault.
*/
function transferToVault(address _token) external {
require(allowRecoverability(_token), ERROR_DISALLOWED);
address vault = getRecoveryVault();
require(isContract(vault), ERROR_VAULT_NOT_CONTRACT);
uint256 balance;
if (_token == ETH) {
balance = address(this).balance;
vault.transfer(balance);
} else {
ERC20 token = ERC20(_token);
balance = token.staticBalanceOf(this);
require(token.safeTransfer(vault, balance), ERROR_TOKEN_TRANSFER_FAILED);
}
emit RecoverToVault(vault, _token, balance);
}
/**
* @dev By default deriving from AragonApp makes it recoverable
* @param token Token address that would be recovered
* @return bool whether the app allows the recovery
*/
function allowRecoverability(address token) public view returns (bool) {
return true;
}
// Cast non-implemented interface to be public so we can use it internally
function getRecoveryVault() public view returns (address);
}pragma solidity 0.4.24;
import "../apps/AppProxyUpgradeable.sol";
import "../apps/AppProxyPinned.sol";
contract AppProxyFactory {
event NewAppProxy(address proxy, bool isUpgradeable, bytes32 appId);
/**
* @notice Create a new upgradeable app instance on `_kernel` with identifier `_appId`
* @param _kernel App's Kernel reference
* @param _appId Identifier for app
* @return AppProxyUpgradeable
*/
function newAppProxy(IKernel _kernel, bytes32 _appId) public returns (AppProxyUpgradeable) {
return newAppProxy(_kernel, _appId, new bytes(0));
}
/**
* @notice Create a new upgradeable app instance on `_kernel` with identifier `_appId` and initialization payload `_initializePayload`
* @param _kernel App's Kernel reference
* @param _appId Identifier for app
* @return AppProxyUpgradeable
*/
function newAppProxy(IKernel _kernel, bytes32 _appId, bytes _initializePayload) public returns (AppProxyUpgradeable) {
AppProxyUpgradeable proxy = new AppProxyUpgradeable(_kernel, _appId, _initializePayload);
emit NewAppProxy(address(proxy), true, _appId);
return proxy;
}
/**
* @notice Create a new pinned app instance on `_kernel` with identifier `_appId`
* @param _kernel App's Kernel reference
* @param _appId Identifier for app
* @return AppProxyPinned
*/
function newAppProxyPinned(IKernel _kernel, bytes32 _appId) public returns (AppProxyPinned) {
return newAppProxyPinned(_kernel, _appId, new bytes(0));
}
/**
* @notice Create a new pinned app instance on `_kernel` with identifier `_appId` and initialization payload `_initializePayload`
* @param _kernel App's Kernel reference
* @param _appId Identifier for app
* @param _initializePayload Proxy initialization payload
* @return AppProxyPinned
*/
function newAppProxyPinned(IKernel _kernel, bytes32 _appId, bytes _initializePayload) public returns (AppProxyPinned) {
AppProxyPinned proxy = new AppProxyPinned(_kernel, _appId, _initializePayload);
emit NewAppProxy(address(proxy), false, _appId);
return proxy;
}
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
import "../acl/IACL.sol";
import "../common/IVaultRecoverable.sol";
interface IKernelEvents {
event SetApp(bytes32 indexed namespace, bytes32 indexed appId, address app);
}
// This should be an interface, but interfaces can't inherit yet :(
contract IKernel is IKernelEvents, IVaultRecoverable {
function acl() public view returns (IACL);
function hasPermission(address who, address where, bytes32 what, bytes how) public view returns (bool);
function setApp(bytes32 namespace, bytes32 appId, address app) public;
function getApp(bytes32 namespace, bytes32 appId) public view returns (address);
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
contract KernelAppIds {
/* Hardcoded constants to save gas
bytes32 internal constant KERNEL_CORE_APP_ID = apmNamehash("kernel");
bytes32 internal constant KERNEL_DEFAULT_ACL_APP_ID = apmNamehash("acl");
bytes32 internal constant KERNEL_DEFAULT_VAULT_APP_ID = apmNamehash("vault");
*/
bytes32 internal constant KERNEL_CORE_APP_ID = 0x3b4bf6bf3ad5000ecf0f989d5befde585c6860fea3e574a4fab4c49d1c177d9c;
bytes32 internal constant KERNEL_DEFAULT_ACL_APP_ID = 0xe3262375f45a6e2026b7e7b18c2b807434f2508fe1a2a3dfb493c7df8f4aad6a;
bytes32 internal constant KERNEL_DEFAULT_VAULT_APP_ID = 0x7e852e0fcfce6551c13800f1e7476f982525c2b5277ba14b24339c68416336d1;
}
contract KernelNamespaceConstants {
/* Hardcoded constants to save gas
bytes32 internal constant KERNEL_CORE_NAMESPACE = keccak256("core");
bytes32 internal constant KERNEL_APP_BASES_NAMESPACE = keccak256("base");
bytes32 internal constant KERNEL_APP_ADDR_NAMESPACE = keccak256("app");
*/
bytes32 internal constant KERNEL_CORE_NAMESPACE = 0xc681a85306374a5ab27f0bbc385296a54bcd314a1948b6cf61c4ea1bc44bb9f8;
bytes32 internal constant KERNEL_APP_BASES_NAMESPACE = 0xf1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f;
bytes32 internal constant KERNEL_APP_ADDR_NAMESPACE = 0xd6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fb;
}pragma solidity 0.4.24;
contract KernelStorage {
// namespace => app id => address
mapping (bytes32 => mapping (bytes32 => address)) public apps;
bytes32 public recoveryVaultAppId;
}/*
* SPDX-License-Identifier: MIT
*/
pragma solidity ^0.4.24;
contract ERCProxy {
uint256 internal constant FORWARDING = 1;
uint256 internal constant UPGRADEABLE = 2;
function proxyType() public pure returns (uint256 proxyTypeId);
function implementation() public view returns (address codeAddr);
}// See https://github.com/OpenZeppelin/openzeppelin-solidity/blob/a9f910d34f0ab33a1ae5e714f69f9596a02b4d91/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.4.24;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}{
"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":true,"inputs":[],"name":"KERNEL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"APP_ADDR_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"getRecoveryVault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_appId","type":"bytes32"},{"name":"_appBase","type":"address"},{"name":"_initializePayload","type":"bytes"},{"name":"_setDefault","type":"bool"}],"name":"newAppInstance","outputs":[{"name":"appProxy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"},{"name":"","type":"bytes32"}],"name":"apps","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_baseAcl","type":"address"},{"name":"_permissionsCreator","type":"address"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CORE_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"allowRecoverability","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_appId","type":"bytes32"},{"name":"_appBase","type":"address"}],"name":"newAppInstance","outputs":[{"name":"appProxy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"recoveryVaultAppId","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getInitializationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_recoveryVaultAppId","type":"bytes32"}],"name":"setRecoveryVaultAppId","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"APP_MANAGER_ROLE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_appId","type":"bytes32"},{"name":"_appBase","type":"address"}],"name":"newPinnedAppInstance","outputs":[{"name":"appProxy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"transferToVault","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_namespace","type":"bytes32"},{"name":"_appId","type":"bytes32"},{"name":"_app","type":"address"}],"name":"setApp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_namespace","type":"bytes32"},{"name":"_appId","type":"bytes32"}],"name":"getApp","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_appId","type":"bytes32"},{"name":"_appBase","type":"address"},{"name":"_initializePayload","type":"bytes"},{"name":"_setDefault","type":"bool"}],"name":"newPinnedAppInstance","outputs":[{"name":"appProxy","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_kernel","type":"address"},{"name":"_appId","type":"bytes32"},{"name":"_initializePayload","type":"bytes"}],"name":"newAppProxyPinned","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"APP_BASES_NAMESPACE","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"acl","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPetrified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_kernel","type":"address"},{"name":"_appId","type":"bytes32"}],"name":"newAppProxy","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"DEFAULT_ACL_APP_ID","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_kernel","type":"address"},{"name":"_appId","type":"bytes32"},{"name":"_initializePayload","type":"bytes"}],"name":"newAppProxy","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"},{"name":"_where","type":"address"},{"name":"_what","type":"bytes32"},{"name":"_how","type":"bytes"}],"name":"hasPermission","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_kernel","type":"address"},{"name":"_appId","type":"bytes32"}],"name":"newAppProxyPinned","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_shouldPetrify","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proxy","type":"address"},{"indexed":false,"name":"isUpgradeable","type":"bool"},{"indexed":false,"name":"appId","type":"bytes32"}],"name":"NewAppProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"vault","type":"address"},{"indexed":true,"name":"token","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RecoverToVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"namespace","type":"bytes32"},{"indexed":true,"name":"appId","type":"bytes32"},{"indexed":false,"name":"app","type":"address"}],"name":"SetApp","type":"event"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405160208062002c37833981016040525180156200003b576200003b6200004260201b60201c565b5062000259565b620000526200014460201b60201c565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a45440000000000000000602082015290156200012e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620000f2578181015183820152602001620000d8565b50505050905090810190601f168015620001205780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50620001426000196200017760201b60201c565b565b60006200017260008051602062002c1783398151915260001b600019166200025160201b620018731760201c565b905090565b620001876200014460201b60201c565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a454400000000000000006020820152901562000226576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252838181518152602001915080519060200190808383600083811015620000f2578181015183820152602001620000d8565b506200024e60008051602062002c178339815191528262000255602090811b62001aa117901c565b50565b5490565b9055565b6129ae80620002696000396000f3006080604052600436106200016a5760003560e01c63ffffffff1680630803fac0146200016f5780631113ed0d146200019b578063178e607914620001c557806332f0a3b514620001dd578063397edd4114620002115780634558850c1462000281578063485cc955146200029f578063756f604914620002cb5780637e7db6e114620002e357806380cd5ac3146200030757806386070cfe146200032e5780638b3dd74914620003465780638c61757d146200035e5780638ea8dc9d1462000379578063958fde8214620003915780639d4941d814620003b8578063ae5b254014620003dc578063be00bbd81462000406578063c050a7a61462000424578063d162f8b01462000494578063db8a61d41462000500578063de2873591462000518578063de4796ed1462000530578063e156a8f31462000548578063e8187ff0146200056f578063ede658b01462000587578063fdef910614620005f3578063ff289fc51462000665575b600080fd5b3480156200017c57600080fd5b50620001876200068c565b604080519115158252519081900360200190f35b348015620001a857600080fd5b50620001b3620006ba565b60408051918252519081900360200190f35b348015620001d257600080fd5b50620001b3620006de565b348015620001ea57600080fd5b50620001f5620006f1565b60408051600160a060020a039092168252519081900360200190f35b3480156200021e57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f59482359460248035600160a060020a0316953695946064949201919081908401838280828437509497505050509135151592506200072e915050565b3480156200028e57600080fd5b50620001f560043560243562000881565b348015620002ac57600080fd5b50620002c9600160a060020a0360043581169060243516620008a4565b005b348015620002d857600080fd5b50620001b362000a54565b348015620002f057600080fd5b5062000187600160a060020a036004351662000a78565b3480156200031457600080fd5b50620001f5600435600160a060020a036024351662000a7e565b3480156200033b57600080fd5b50620001b362000b5e565b3480156200035357600080fd5b50620001b362000b64565b3480156200036b57600080fd5b50620002c960043562000b96565b3480156200038657600080fd5b50620001b362000c53565b3480156200039e57600080fd5b50620001f5600435600160a060020a036024351662000c66565b348015620003c557600080fd5b50620002c9600160a060020a036004351662000d3d565b348015620003e957600080fd5b50620002c9600435602435600160a060020a036044351662000fe2565b3480156200041357600080fd5b50620001f56004356024356200109d565b3480156200043157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f59482359460248035600160a060020a031695369594606494920191908190840183828082843750949750505050913515159250620010c1915050565b348015620004a157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f5948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506200119d9650505050505050565b3480156200050d57600080fd5b50620001b3620012a8565b3480156200052557600080fd5b50620001f5620012bb565b3480156200053d57600080fd5b5062000187620012e7565b3480156200055557600080fd5b50620001f5600160a060020a0360043516602435620012fc565b3480156200057c57600080fd5b50620001b362001322565b3480156200059457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f5948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750620013359650505050505050565b3480156200060057600080fd5b50604080516020601f6064356004818101359283018490048402850184019095528184526200018794600160a060020a038135811695602480359092169560443595369560849401918190840183828082843750949750620014409650505050505050565b3480156200067257600080fd5b50620001f5600160a060020a036004351660243562001583565b6000806200069962000b64565b90508015801590620006b4575080620006b1620015a2565b10155b91505090565b7f3b4bf6bf3ad5000ecf0f989d5befde585c6860fea3e574a4fab4c49d1c177d9c90565b6000805160206200296383398151915290565b60015460009081527f9e3eae70920eeef6013879bf9155b985893698c145361c31365929723678b2576020526040902054600160a060020a031690565b6000600080516020620028e38339815191526200075b6000805160206200290383398151915287620015a6565b620007733330846200076d85620015ba565b62001440565b6040805180820190915260128152600080516020620029438339815191526020820152901515620008285760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620007ec578181015183820152602001620007d2565b50505050905090810190601f1680156200081a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5062000845600080516020620029038339815191528888620015c4565b6200085230888762001335565b9250831562000877576200087760008051602062002963833981519152888562000fe2565b5050949350505050565b6000602081815292815260408082209093529081522054600160a060020a031681565b6000620008b062000b64565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a4544000000000000000060208201529015620009385760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200094362001693565b6200096e60008051602062002903833981519152600080516020620029238339815191528562001764565b620009893060008051602062002923833981519152620012fc565b905080600160a060020a031663c4d66de8836040518263ffffffff1660e01b81526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b158015620009e457600080fd5b505af1158015620009f9573d6000803e3d6000fd5b5062000a2b92506000805160206200296383398151915291506000805160206200292383398151915290508362001764565b50507f7e852e0fcfce6551c13800f1e7476f982525c2b5277ba14b24339c68416336d160015550565b7fc681a85306374a5ab27f0bbc385296a54bcd314a1948b6cf61c4ea1bc44bb9f890565b50600190565b6000600080516020620028e383398151915262000aab6000805160206200290383398151915285620015a6565b62000abd3330846200076d85620015ba565b604080518082019091526012815260008051602062002943833981519152602082015290151562000b355760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506040805160008082526020820190925262000b5591879187916200072e565b95945050505050565b60015481565b600062000b917febb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e62001873565b905090565b600080516020620028e383398151915262000bc16000805160206200296383398151915283620015a6565b62000bd33330846200076d85620015ba565b604080518082019091526012815260008051602062002943833981519152602082015290151562000c4b5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b505050600155565b600080516020620028e383398151915281565b6000600080516020620028e383398151915262000c936000805160206200290383398151915285620015a6565b62000ca53330846200076d85620015ba565b604080518082019091526012815260008051602062002943833981519152602082015290151562000d1d5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506040805160008082526020820190925262000b559187918791620010c1565b600080600062000d4d8462000a78565b60408051808201909152601281527f5245434f5645525f444953414c4c4f5745440000000000000000000000000000602082015290151562000dd65760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b5062000de1620006f1565b925062000dee8362001877565b60408051808201909152601a81527f5245434f5645525f5641554c545f4e4f545f434f4e5452414354000000000000602082015290151562000e775760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b50600160a060020a038416151562000ecb5760405130319250600160a060020a0384169083156108fc029084906000818181858888f1935050505015801562000ec4573d6000803e3d6000fd5b5062000f91565b508262000ee8600160a060020a0382163063ffffffff620018a616565b915062000f06600160a060020a038216848463ffffffff620019c016565b60408051808201909152601d81527f5245434f5645525f544f4b454e5f5452414e534645525f4641494c4544000000602082015290151562000f8f5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b505b83600160a060020a031683600160a060020a03167f596caf56044b55fb8c4ca640089bbc2b63cae3e978b851f5745cbb7c5b288e02846040518082815260200191505060405180910390a350505050565b600080516020620028e383398151915262000ffe8484620015a6565b620010103330846200076d85620015ba565b6040805180820190915260128152600080516020620029438339815191526020820152901515620010885760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200109685858562001764565b5050505050565b600091825260208281526040808420928452919052902054600160a060020a031690565b6000600080516020620028e3833981519152620010ee6000805160206200290383398151915287620015a6565b620011003330846200076d85620015ba565b6040805180820190915260128152600080516020620029438339815191526020820152901515620011785760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b5062001195600080516020620029038339815191528888620015c4565b620008523088875b600080848484620011ad62001b2a565b600160a060020a038416815260208082018490526060604083018181528451918401919091528351909160808401919085019080838360005b8381101562001200578181015183820152602001620011e6565b50505050905090810190601f1680156200122e5780820380516001836020036101000a031916815260200191505b50945050505050604051809103906000f08015801562001252573d6000803e3d6000fd5b5060408051600160a060020a03831681526000602082015280820187905290519192507fd880e726dced8808d727f02dd0e6fdd3a945b24bfee77e13367bcbe61ddbaf47919081900360600190a1949350505050565b6000805160206200290383398151915290565b600062000b9160008051602062002963833981519152600080516020620029238339815191526200109d565b6000600019620012f662000b64565b14905090565b604080516000808252602082019092526200131b908490849062001335565b9392505050565b6000805160206200292383398151915290565b6000808484846200134562001b3b565b600160a060020a038416815260208082018490526060604083018181528451918401919091528351909160808401919085019080838360005b83811015620013985781810151838201526020016200137e565b50505050905090810190601f168015620013c65780820380516001836020036101000a031916815260200191505b50945050505050604051809103906000f080158015620013ea573d6000803e3d6000fd5b5060408051600160a060020a03831681526001602082015280820187905290519192507fd880e726dced8808d727f02dd0e6fdd3a945b24bfee77e13367bcbe61ddbaf47919081900360600190a1949350505050565b6000806200144d620012bb565b9050600160a060020a038116158015906200157957506040517ffdef9106000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483019081528782166024840152604483018790526080606484019081528651608485015286519285169363fdef9106938b938b938b938b9360a490910190602085019080838360005b83811015620014f9578181015183820152602001620014df565b50505050905090810190601f168015620015275780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156200154a57600080fd5b505af11580156200155f573d6000803e3d6000fd5b505050506040513d60208110156200157657600080fd5b50515b9695505050505050565b604080516000808252602082019092526200131b90849084906200119d565b4390565b60606200131b8360001c8360001c62001a44565b8051602002815290565b6000620015d284846200109d565b9050600160a060020a03811615620016805760408051808201909152601981527f4b45524e454c5f494e56414c49445f4150505f4348414e4745000000000000006020820152600160a060020a0382811690841614620016795760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200168d565b6200168d84848462001764565b50505050565b6200169d62000b64565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a4544000000000000000060208201529015620017255760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200176262001734620015a2565b7febb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e9063ffffffff62001aa116565b565b6200176f8162001877565b60408051808201909152601781527f4b45524e454c5f4150505f4e4f545f434f4e54524143540000000000000000006020820152901515620017f85760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b50600083815260208181526040808320858452825291829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851690811790915582519081529151849286927f2ec1ae0a449b7ae354b9dacfb3ade6b6332ba26b7fcbb935835fa39dd7263b2392918290030190a3505050565b5490565b600080600160a060020a0383161515620018955760009150620018a0565b823b90506000811191505b50919050565b60408051600160a060020a0383166024808301919091528251808303909101815260449091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f70a0823100000000000000000000000000000000000000000000000000000000179052600090818062001928868462001aa5565b60408051808201909152601c81527f534146455f4552435f32305f42414c414e43455f52455645525445440000000060208201529193509150821515620019b65760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b5095945050505050565b60408051600160a060020a038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905260009062000b55858262001ad7565b60408051600280825260608083018452926020830190803883390190505090508281600081518110151562001a7557fe5b60209081029091010152805182908290600190811062001a9157fe5b6020908102909101015292915050565b9055565b6000806000806040516020818751602089018a5afa9250600083111562001acb57805191505b50909590945092505050565b6000806040516020818551602087016000895af1600081111562001b20573d801562001b0c576020811462001b165762001b1e565b6001935062001b1e565b600183511493505b505b5090949350505050565b6040516106cb8062001b4d83390190565b6040516106cb8062002218833901905600608060405234801561001057600080fd5b506040516106cb3803806106cb83398101604090815281516020808401519284015191939190910190839083908390600090610051908590610165811b901c565b6100608361018b60201b60201c565b61006f836101c060201b60201c565b90506000825111156101155761008a8161028d60201b60201c565b151561009557600080fd5b80600160a060020a03168260405180828051906020019080838360005b838110156100ca5781810151838201526020016100b2565b50505050905090810190601f1680156100f75780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561011557600080fd5b5050505061013661012b836101c060201b60201c565b6102ba60201b60201c565b6101526101476102dd60201b60201c565b61028d60201b60201c565b151561015d57600080fd5b50505061033e565b61018860008051602061068b8339815191528261030c602090811b61030a17901c565b50565b6101887fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b8261030c602090811b61030a17901c565b60006101d061031060201b60201c565b604080517fbe00bbd80000000000000000000000000000000000000000000000000000000081527ff1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f6004820152602481018590529051600160a060020a03929092169163be00bbd8916044808201926020929091908290030181600087803b15801561025b57600080fd5b505af115801561026f573d6000803e3d6000fd5b505050506040513d602081101561028557600080fd5b505192915050565b600080600160a060020a03831615156102a957600091506102b4565b823b90506000811191505b50919050565b6101886000805160206106ab8339815191528261030c602090811b61030a17901c565b60006103076000805160206106ab83398151915260001b6000191661033a60201b6103021760201c565b905090565b9055565b600061030760008051602061068b83398151915260001b6000191661033a60201b6103021760201c565b5490565b61033e8061034d6000396000f3006080604052600436106100505760003560e01c63ffffffff1680634555d5c91461010f57806348a0c8dd146101365780635c60da1b1461015f57806380afdea81461019d578063d4aae0c4146101b2575b6127107f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea6000825a10156100c55760003411361583541616156100c0576040513381523460208201527f15eeaa57c7bd188c1388020bcadc2c436ec60d647d36ef5b9eb3c742217ddee1604082a1005b600080fd5b6100cd6101c7565b905061010a816000368080601f016020809104026020016040519081016040528093929190818152602001838380828437506101d6945050505050565b505050005b34801561011b57600080fd5b50610124610217565b60408051918252519081900360200190f35b34801561014257600080fd5b5061014b61021c565b604080519115158252519081900360200190f35b34801561016b57600080fd5b506101746101c7565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101a957600080fd5b50610124610247565b3480156101be57600080fd5b50610174610272565b60006101d161029d565b905090565b60006101e1836102c8565b15156101ec57600080fd5b612710905060008083516020850186855a03f43d604051816000823e828015610213578282f35b8282fd5b600190565b60006101d17f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea610302565b60006101d17fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b610302565b60006101d17f4172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137b610302565b60006101d17fdee64df20d65e53d7f51cb6ab6d921a0a6a638a91e942e1d8d02df28e31c038e610302565b60008073ffffffffffffffffffffffffffffffffffffffff831615156102f157600091506102fc565b823b90506000811191505b50919050565b5490565b5490565b9055565b90555600a165627a7a7230582066039f53702494556ddb0724479babb75bb46e39aaf45f648059300454f79e0200294172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137bdee64df20d65e53d7f51cb6ab6d921a0a6a638a91e942e1d8d02df28e31c038e608060405234801561001057600080fd5b506040516106cb3803806106cb83398101604090815281516020808401519284015191939190910190839083908390600090610051908590610121811b901c565b6100608361014760201b60201c565b61006f8361017c60201b60201c565b90506000825111156101155761008a8161024960201b60201c565b151561009557600080fd5b80600160a060020a03168260405180828051906020019080838360005b838110156100ca5781810151838201526020016100b2565b50505050905090810190601f1680156100f75780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561011557600080fd5b505050505050506102ad565b6101446000805160206106ab83398151915282610276602090811b6103bb17901c565b50565b6101447fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b82610276602090811b6103bb17901c565b600061018c61027a60201b60201c565b604080517fbe00bbd80000000000000000000000000000000000000000000000000000000081527ff1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f6004820152602481018590529051600160a060020a03929092169163be00bbd8916044808201926020929091908290030181600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d602081101561024157600080fd5b505192915050565b600080600160a060020a03831615156102655760009150610270565b823b90506000811191505b50919050565b9055565b60006102a46000805160206106ab83398151915260001b600019166102a960201b6103b31760201c565b905090565b5490565b6103ef806102bc6000396000f3006080604052600436106100505760003560e01c63ffffffff1680634555d5c91461010f57806348a0c8dd146101365780635c60da1b1461015f57806380afdea81461019d578063d4aae0c4146101b2575b6127107f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea6000825a10156100c55760003411361583541616156100c0576040513381523460208201527f15eeaa57c7bd188c1388020bcadc2c436ec60d647d36ef5b9eb3c742217ddee1604082a1005b600080fd5b6100cd6101c7565b905061010a816000368080601f016020809104026020016040519081016040528093929190818152602001838380828437506101de945050505050565b505050005b34801561011b57600080fd5b5061012461021f565b60408051918252519081900360200190f35b34801561014257600080fd5b5061014b610224565b604080519115158252519081900360200190f35b34801561016b57600080fd5b506101746101c7565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101a957600080fd5b5061012461024f565b3480156101be57600080fd5b5061017461027a565b60006101d96101d461024f565b6102a5565b905090565b60006101e983610379565b15156101f457600080fd5b612710905060008083516020850186855a03f43d604051816000823e82801561021b578282f35b8282fd5b600290565b60006101d97f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea6103b3565b60006101d97fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b6103b3565b60006101d97f4172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137b6103b3565b60006102af61027a565b604080517fbe00bbd80000000000000000000000000000000000000000000000000000000081527ff1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff929092169163be00bbd8916044808201926020929091908290030181600087803b15801561034757600080fd5b505af115801561035b573d6000803e3d6000fd5b505050506040513d602081101561037157600080fd5b505192915050565b60008073ffffffffffffffffffffffffffffffffffffffff831615156103a257600091506103ad565b823b90506000811191505b50919050565b5490565b5490565b9055565b90555600a165627a7a723058201f7172bafbfd668d51a2f5278c487bd0c3ae1b874a501ce6d1eb7aa8dbccb18600294172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137bb6d92708f3d4817afc106147d969e229ced5c46e65e0a5002a0d391287762bd0f1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0fe3262375f45a6e2026b7e7b18c2b807434f2508fe1a2a3dfb493c7df8f4aad6a4b45524e454c5f415554485f4641494c45440000000000000000000000000000d6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fba165627a7a7230582004fac81cfa1db2603543bc6f2a3bb977e2f9930bcb5c865b911b1e35e3a0105b0029ebb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e0000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x6080604052600436106200016a5760003560e01c63ffffffff1680630803fac0146200016f5780631113ed0d146200019b578063178e607914620001c557806332f0a3b514620001dd578063397edd4114620002115780634558850c1462000281578063485cc955146200029f578063756f604914620002cb5780637e7db6e114620002e357806380cd5ac3146200030757806386070cfe146200032e5780638b3dd74914620003465780638c61757d146200035e5780638ea8dc9d1462000379578063958fde8214620003915780639d4941d814620003b8578063ae5b254014620003dc578063be00bbd81462000406578063c050a7a61462000424578063d162f8b01462000494578063db8a61d41462000500578063de2873591462000518578063de4796ed1462000530578063e156a8f31462000548578063e8187ff0146200056f578063ede658b01462000587578063fdef910614620005f3578063ff289fc51462000665575b600080fd5b3480156200017c57600080fd5b50620001876200068c565b604080519115158252519081900360200190f35b348015620001a857600080fd5b50620001b3620006ba565b60408051918252519081900360200190f35b348015620001d257600080fd5b50620001b3620006de565b348015620001ea57600080fd5b50620001f5620006f1565b60408051600160a060020a039092168252519081900360200190f35b3480156200021e57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f59482359460248035600160a060020a0316953695946064949201919081908401838280828437509497505050509135151592506200072e915050565b3480156200028e57600080fd5b50620001f560043560243562000881565b348015620002ac57600080fd5b50620002c9600160a060020a0360043581169060243516620008a4565b005b348015620002d857600080fd5b50620001b362000a54565b348015620002f057600080fd5b5062000187600160a060020a036004351662000a78565b3480156200031457600080fd5b50620001f5600435600160a060020a036024351662000a7e565b3480156200033b57600080fd5b50620001b362000b5e565b3480156200035357600080fd5b50620001b362000b64565b3480156200036b57600080fd5b50620002c960043562000b96565b3480156200038657600080fd5b50620001b362000c53565b3480156200039e57600080fd5b50620001f5600435600160a060020a036024351662000c66565b348015620003c557600080fd5b50620002c9600160a060020a036004351662000d3d565b348015620003e957600080fd5b50620002c9600435602435600160a060020a036044351662000fe2565b3480156200041357600080fd5b50620001f56004356024356200109d565b3480156200043157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f59482359460248035600160a060020a031695369594606494920191908190840183828082843750949750505050913515159250620010c1915050565b348015620004a157600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f5948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506200119d9650505050505050565b3480156200050d57600080fd5b50620001b3620012a8565b3480156200052557600080fd5b50620001f5620012bb565b3480156200053d57600080fd5b5062000187620012e7565b3480156200055557600080fd5b50620001f5600160a060020a0360043516602435620012fc565b3480156200057c57600080fd5b50620001b362001322565b3480156200059457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452620001f5948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750620013359650505050505050565b3480156200060057600080fd5b50604080516020601f6064356004818101359283018490048402850184019095528184526200018794600160a060020a038135811695602480359092169560443595369560849401918190840183828082843750949750620014409650505050505050565b3480156200067257600080fd5b50620001f5600160a060020a036004351660243562001583565b6000806200069962000b64565b90508015801590620006b4575080620006b1620015a2565b10155b91505090565b7f3b4bf6bf3ad5000ecf0f989d5befde585c6860fea3e574a4fab4c49d1c177d9c90565b6000805160206200296383398151915290565b60015460009081527f9e3eae70920eeef6013879bf9155b985893698c145361c31365929723678b2576020526040902054600160a060020a031690565b6000600080516020620028e38339815191526200075b6000805160206200290383398151915287620015a6565b620007733330846200076d85620015ba565b62001440565b6040805180820190915260128152600080516020620029438339815191526020820152901515620008285760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620007ec578181015183820152602001620007d2565b50505050905090810190601f1680156200081a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5062000845600080516020620029038339815191528888620015c4565b6200085230888762001335565b9250831562000877576200087760008051602062002963833981519152888562000fe2565b5050949350505050565b6000602081815292815260408082209093529081522054600160a060020a031681565b6000620008b062000b64565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a4544000000000000000060208201529015620009385760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200094362001693565b6200096e60008051602062002903833981519152600080516020620029238339815191528562001764565b620009893060008051602062002923833981519152620012fc565b905080600160a060020a031663c4d66de8836040518263ffffffff1660e01b81526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b158015620009e457600080fd5b505af1158015620009f9573d6000803e3d6000fd5b5062000a2b92506000805160206200296383398151915291506000805160206200292383398151915290508362001764565b50507f7e852e0fcfce6551c13800f1e7476f982525c2b5277ba14b24339c68416336d160015550565b7fc681a85306374a5ab27f0bbc385296a54bcd314a1948b6cf61c4ea1bc44bb9f890565b50600190565b6000600080516020620028e383398151915262000aab6000805160206200290383398151915285620015a6565b62000abd3330846200076d85620015ba565b604080518082019091526012815260008051602062002943833981519152602082015290151562000b355760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506040805160008082526020820190925262000b5591879187916200072e565b95945050505050565b60015481565b600062000b917febb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e62001873565b905090565b600080516020620028e383398151915262000bc16000805160206200296383398151915283620015a6565b62000bd33330846200076d85620015ba565b604080518082019091526012815260008051602062002943833981519152602082015290151562000c4b5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b505050600155565b600080516020620028e383398151915281565b6000600080516020620028e383398151915262000c936000805160206200290383398151915285620015a6565b62000ca53330846200076d85620015ba565b604080518082019091526012815260008051602062002943833981519152602082015290151562000d1d5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506040805160008082526020820190925262000b559187918791620010c1565b600080600062000d4d8462000a78565b60408051808201909152601281527f5245434f5645525f444953414c4c4f5745440000000000000000000000000000602082015290151562000dd65760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b5062000de1620006f1565b925062000dee8362001877565b60408051808201909152601a81527f5245434f5645525f5641554c545f4e4f545f434f4e5452414354000000000000602082015290151562000e775760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b50600160a060020a038416151562000ecb5760405130319250600160a060020a0384169083156108fc029084906000818181858888f1935050505015801562000ec4573d6000803e3d6000fd5b5062000f91565b508262000ee8600160a060020a0382163063ffffffff620018a616565b915062000f06600160a060020a038216848463ffffffff620019c016565b60408051808201909152601d81527f5245434f5645525f544f4b454e5f5452414e534645525f4641494c4544000000602082015290151562000f8f5760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b505b83600160a060020a031683600160a060020a03167f596caf56044b55fb8c4ca640089bbc2b63cae3e978b851f5745cbb7c5b288e02846040518082815260200191505060405180910390a350505050565b600080516020620028e383398151915262000ffe8484620015a6565b620010103330846200076d85620015ba565b6040805180820190915260128152600080516020620029438339815191526020820152901515620010885760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200109685858562001764565b5050505050565b600091825260208281526040808420928452919052902054600160a060020a031690565b6000600080516020620028e3833981519152620010ee6000805160206200290383398151915287620015a6565b620011003330846200076d85620015ba565b6040805180820190915260128152600080516020620029438339815191526020820152901515620011785760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b5062001195600080516020620029038339815191528888620015c4565b620008523088875b600080848484620011ad62001b2a565b600160a060020a038416815260208082018490526060604083018181528451918401919091528351909160808401919085019080838360005b8381101562001200578181015183820152602001620011e6565b50505050905090810190601f1680156200122e5780820380516001836020036101000a031916815260200191505b50945050505050604051809103906000f08015801562001252573d6000803e3d6000fd5b5060408051600160a060020a03831681526000602082015280820187905290519192507fd880e726dced8808d727f02dd0e6fdd3a945b24bfee77e13367bcbe61ddbaf47919081900360600190a1949350505050565b6000805160206200290383398151915290565b600062000b9160008051602062002963833981519152600080516020620029238339815191526200109d565b6000600019620012f662000b64565b14905090565b604080516000808252602082019092526200131b908490849062001335565b9392505050565b6000805160206200292383398151915290565b6000808484846200134562001b3b565b600160a060020a038416815260208082018490526060604083018181528451918401919091528351909160808401919085019080838360005b83811015620013985781810151838201526020016200137e565b50505050905090810190601f168015620013c65780820380516001836020036101000a031916815260200191505b50945050505050604051809103906000f080158015620013ea573d6000803e3d6000fd5b5060408051600160a060020a03831681526001602082015280820187905290519192507fd880e726dced8808d727f02dd0e6fdd3a945b24bfee77e13367bcbe61ddbaf47919081900360600190a1949350505050565b6000806200144d620012bb565b9050600160a060020a038116158015906200157957506040517ffdef9106000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483019081528782166024840152604483018790526080606484019081528651608485015286519285169363fdef9106938b938b938b938b9360a490910190602085019080838360005b83811015620014f9578181015183820152602001620014df565b50505050905090810190601f168015620015275780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156200154a57600080fd5b505af11580156200155f573d6000803e3d6000fd5b505050506040513d60208110156200157657600080fd5b50515b9695505050505050565b604080516000808252602082019092526200131b90849084906200119d565b4390565b60606200131b8360001c8360001c62001a44565b8051602002815290565b6000620015d284846200109d565b9050600160a060020a03811615620016805760408051808201909152601981527f4b45524e454c5f494e56414c49445f4150505f4348414e4745000000000000006020820152600160a060020a0382811690841614620016795760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200168d565b6200168d84848462001764565b50505050565b6200169d62000b64565b60408051808201909152601881527f494e49545f414c52454144595f494e495449414c495a4544000000000000000060208201529015620017255760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b506200176262001734620015a2565b7febb05b386a8d34882b8711d156f463690983dc47815980fb82aeeff1aa43579e9063ffffffff62001aa116565b565b6200176f8162001877565b60408051808201909152601781527f4b45524e454c5f4150505f4e4f545f434f4e54524143540000000000000000006020820152901515620017f85760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b50600083815260208181526040808320858452825291829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851690811790915582519081529151849286927f2ec1ae0a449b7ae354b9dacfb3ade6b6332ba26b7fcbb935835fa39dd7263b2392918290030190a3505050565b5490565b600080600160a060020a0383161515620018955760009150620018a0565b823b90506000811191505b50919050565b60408051600160a060020a0383166024808301919091528251808303909101815260449091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f70a0823100000000000000000000000000000000000000000000000000000000179052600090818062001928868462001aa5565b60408051808201909152601c81527f534146455f4552435f32305f42414c414e43455f52455645525445440000000060208201529193509150821515620019b65760405160e560020a62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015620007ec578181015183820152602001620007d2565b5095945050505050565b60408051600160a060020a038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905260009062000b55858262001ad7565b60408051600280825260608083018452926020830190803883390190505090508281600081518110151562001a7557fe5b60209081029091010152805182908290600190811062001a9157fe5b6020908102909101015292915050565b9055565b6000806000806040516020818751602089018a5afa9250600083111562001acb57805191505b50909590945092505050565b6000806040516020818551602087016000895af1600081111562001b20573d801562001b0c576020811462001b165762001b1e565b6001935062001b1e565b600183511493505b505b5090949350505050565b6040516106cb8062001b4d83390190565b6040516106cb8062002218833901905600608060405234801561001057600080fd5b506040516106cb3803806106cb83398101604090815281516020808401519284015191939190910190839083908390600090610051908590610165811b901c565b6100608361018b60201b60201c565b61006f836101c060201b60201c565b90506000825111156101155761008a8161028d60201b60201c565b151561009557600080fd5b80600160a060020a03168260405180828051906020019080838360005b838110156100ca5781810151838201526020016100b2565b50505050905090810190601f1680156100f75780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561011557600080fd5b5050505061013661012b836101c060201b60201c565b6102ba60201b60201c565b6101526101476102dd60201b60201c565b61028d60201b60201c565b151561015d57600080fd5b50505061033e565b61018860008051602061068b8339815191528261030c602090811b61030a17901c565b50565b6101887fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b8261030c602090811b61030a17901c565b60006101d061031060201b60201c565b604080517fbe00bbd80000000000000000000000000000000000000000000000000000000081527ff1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f6004820152602481018590529051600160a060020a03929092169163be00bbd8916044808201926020929091908290030181600087803b15801561025b57600080fd5b505af115801561026f573d6000803e3d6000fd5b505050506040513d602081101561028557600080fd5b505192915050565b600080600160a060020a03831615156102a957600091506102b4565b823b90506000811191505b50919050565b6101886000805160206106ab8339815191528261030c602090811b61030a17901c565b60006103076000805160206106ab83398151915260001b6000191661033a60201b6103021760201c565b905090565b9055565b600061030760008051602061068b83398151915260001b6000191661033a60201b6103021760201c565b5490565b61033e8061034d6000396000f3006080604052600436106100505760003560e01c63ffffffff1680634555d5c91461010f57806348a0c8dd146101365780635c60da1b1461015f57806380afdea81461019d578063d4aae0c4146101b2575b6127107f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea6000825a10156100c55760003411361583541616156100c0576040513381523460208201527f15eeaa57c7bd188c1388020bcadc2c436ec60d647d36ef5b9eb3c742217ddee1604082a1005b600080fd5b6100cd6101c7565b905061010a816000368080601f016020809104026020016040519081016040528093929190818152602001838380828437506101d6945050505050565b505050005b34801561011b57600080fd5b50610124610217565b60408051918252519081900360200190f35b34801561014257600080fd5b5061014b61021c565b604080519115158252519081900360200190f35b34801561016b57600080fd5b506101746101c7565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101a957600080fd5b50610124610247565b3480156101be57600080fd5b50610174610272565b60006101d161029d565b905090565b60006101e1836102c8565b15156101ec57600080fd5b612710905060008083516020850186855a03f43d604051816000823e828015610213578282f35b8282fd5b600190565b60006101d17f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea610302565b60006101d17fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b610302565b60006101d17f4172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137b610302565b60006101d17fdee64df20d65e53d7f51cb6ab6d921a0a6a638a91e942e1d8d02df28e31c038e610302565b60008073ffffffffffffffffffffffffffffffffffffffff831615156102f157600091506102fc565b823b90506000811191505b50919050565b5490565b5490565b9055565b90555600a165627a7a7230582066039f53702494556ddb0724479babb75bb46e39aaf45f648059300454f79e0200294172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137bdee64df20d65e53d7f51cb6ab6d921a0a6a638a91e942e1d8d02df28e31c038e608060405234801561001057600080fd5b506040516106cb3803806106cb83398101604090815281516020808401519284015191939190910190839083908390600090610051908590610121811b901c565b6100608361014760201b60201c565b61006f8361017c60201b60201c565b90506000825111156101155761008a8161024960201b60201c565b151561009557600080fd5b80600160a060020a03168260405180828051906020019080838360005b838110156100ca5781810151838201526020016100b2565b50505050905090810190601f1680156100f75780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561011557600080fd5b505050505050506102ad565b6101446000805160206106ab83398151915282610276602090811b6103bb17901c565b50565b6101447fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b82610276602090811b6103bb17901c565b600061018c61027a60201b60201c565b604080517fbe00bbd80000000000000000000000000000000000000000000000000000000081527ff1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f6004820152602481018590529051600160a060020a03929092169163be00bbd8916044808201926020929091908290030181600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d602081101561024157600080fd5b505192915050565b600080600160a060020a03831615156102655760009150610270565b823b90506000811191505b50919050565b9055565b60006102a46000805160206106ab83398151915260001b600019166102a960201b6103b31760201c565b905090565b5490565b6103ef806102bc6000396000f3006080604052600436106100505760003560e01c63ffffffff1680634555d5c91461010f57806348a0c8dd146101365780635c60da1b1461015f57806380afdea81461019d578063d4aae0c4146101b2575b6127107f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea6000825a10156100c55760003411361583541616156100c0576040513381523460208201527f15eeaa57c7bd188c1388020bcadc2c436ec60d647d36ef5b9eb3c742217ddee1604082a1005b600080fd5b6100cd6101c7565b905061010a816000368080601f016020809104026020016040519081016040528093929190818152602001838380828437506101de945050505050565b505050005b34801561011b57600080fd5b5061012461021f565b60408051918252519081900360200190f35b34801561014257600080fd5b5061014b610224565b604080519115158252519081900360200190f35b34801561016b57600080fd5b506101746101c7565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156101a957600080fd5b5061012461024f565b3480156101be57600080fd5b5061017461027a565b60006101d96101d461024f565b6102a5565b905090565b60006101e983610379565b15156101f457600080fd5b612710905060008083516020850186855a03f43d604051816000823e82801561021b578282f35b8282fd5b600290565b60006101d97f665fd576fbbe6f247aff98f5c94a561e3f71ec2d3c988d56f12d342396c50cea6103b3565b60006101d97fd625496217aa6a3453eecb9c3489dc5a53e6c67b444329ea2b2cbc9ff547639b6103b3565b60006101d97f4172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137b6103b3565b60006102af61027a565b604080517fbe00bbd80000000000000000000000000000000000000000000000000000000081527ff1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0f600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff929092169163be00bbd8916044808201926020929091908290030181600087803b15801561034757600080fd5b505af115801561035b573d6000803e3d6000fd5b505050506040513d602081101561037157600080fd5b505192915050565b60008073ffffffffffffffffffffffffffffffffffffffff831615156103a257600091506103ad565b823b90506000811191505b50919050565b5490565b5490565b9055565b90555600a165627a7a723058201f7172bafbfd668d51a2f5278c487bd0c3ae1b874a501ce6d1eb7aa8dbccb18600294172f0f7d2289153072b0a6ca36959e0cbe2efc3afe50fc81636caa96338137bb6d92708f3d4817afc106147d969e229ced5c46e65e0a5002a0d391287762bd0f1f3eb40f5bc1ad1344716ced8b8a0431d840b5783aea1fd01786bc26f35ac0fe3262375f45a6e2026b7e7b18c2b807434f2508fe1a2a3dfb493c7df8f4aad6a4b45524e454c5f415554485f4641494c45440000000000000000000000000000d6f028ca0e8edb4a8c9757ca4fdccab25fa1e0317da1188108f7d2dee14902fba165627a7a7230582004fac81cfa1db2603543bc6f2a3bb977e2f9930bcb5c865b911b1e35e3a0105b0029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _shouldPetrify (bool): True
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000001
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.