From 095c036ea34c6c3740cfb09e4349bab2c46982e1 Mon Sep 17 00:00:00 2001 From: gitpusha Date: Mon, 17 Aug 2020 12:17:04 +0200 Subject: [PATCH] Gelato DSA setup tests complete --- .gitattributes | 1 + .gitignore | 16 + .vscode/settings.json | 29 + buidler.config.js | 154 + .../ConditionCompareUintsFromTwoSources.sol | 102 + contracts/ConditionHasBalanceAndAllowance.sol | 75 + contracts/ConnectGelato.sol | 136 + contracts/GelatoBytes.sol | 67 + contracts/MockCDAI.sol | 17 + contracts/MockDSR.sol | 19 + contracts/ProviderModuleDSA.sol | 104 + package.json | 22 + pre-compiles/ConnectAuth.json | 104 + pre-compiles/ConnectBasic.json | 169 + pre-compiles/ConnectCompound.json | 549 ++ pre-compiles/ConnectMaker.json | 639 ++ pre-compiles/IERC20.json | 192 + pre-compiles/IUniswapExchange.json | 318 + pre-compiles/InstaAccount.json | 197 + pre-compiles/InstaConnectors.json | 324 + pre-compiles/InstaIndex.json | 387 + pre-compiles/InstaList.json | 228 + rinkeby-test/0-1-tx-onboarding.js | 389 + rinkeby-test/1-GnosisSafe-Gelato-setup.js | 264 + rinkeby-test/2-submitTask.js | 197 + rinkeby-test/3-unprovide-ETH.js | 129 + .../4-transfer-funds-from-GnosisSafe.js | 95 + rinkeby-test/5-multiUnprovide.js | 200 + rinkeby-test/6-cancelTask.js | 186 + test/mv-DAI-DSR-Compound.test.js | 185 + test/setup-DSA-Gelato.test.js | 281 + yarn.lock | 8512 +++++++++++++++++ 32 files changed, 14287 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 buidler.config.js create mode 100644 contracts/ConditionCompareUintsFromTwoSources.sol create mode 100644 contracts/ConditionHasBalanceAndAllowance.sol create mode 100644 contracts/ConnectGelato.sol create mode 100644 contracts/GelatoBytes.sol create mode 100644 contracts/MockCDAI.sol create mode 100644 contracts/MockDSR.sol create mode 100644 contracts/ProviderModuleDSA.sol create mode 100644 package.json create mode 100644 pre-compiles/ConnectAuth.json create mode 100644 pre-compiles/ConnectBasic.json create mode 100644 pre-compiles/ConnectCompound.json create mode 100644 pre-compiles/ConnectMaker.json create mode 100644 pre-compiles/IERC20.json create mode 100644 pre-compiles/IUniswapExchange.json create mode 100644 pre-compiles/InstaAccount.json create mode 100644 pre-compiles/InstaConnectors.json create mode 100644 pre-compiles/InstaIndex.json create mode 100644 pre-compiles/InstaList.json create mode 100644 rinkeby-test/0-1-tx-onboarding.js create mode 100644 rinkeby-test/1-GnosisSafe-Gelato-setup.js create mode 100644 rinkeby-test/2-submitTask.js create mode 100644 rinkeby-test/3-unprovide-ETH.js create mode 100644 rinkeby-test/4-transfer-funds-from-GnosisSafe.js create mode 100644 rinkeby-test/5-multiUnprovide.js create mode 100644 rinkeby-test/6-cancelTask.js create mode 100644 test/mv-DAI-DSR-Compound.test.js create mode 100644 test/setup-DSA-Gelato.test.js create mode 100644 yarn.lock diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..52031de --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sol linguist-language=Solidity diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..547b13f --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# Dependency directory +node_modules + +# local env variables +.env + +#buidler +artifacts/ +cache/ + +# macOS +.DS_Store +*.icloud + +# yarn +yarn-error.log diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..54a79d5 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,29 @@ +{ + // HTML + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + // Javascript + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + // JSON + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + // Solidity + "solidity.formatter": "none", + "solidity.linter": "solhint", + "solidity.packageDefaultDependenciesContractsDirectory": "", + "solidity.packageDefaultDependenciesDirectory": "node_modules", + "solidity.solhintRules": { + "quotes": ["error", "double"] + }, + // Typscript + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + } +} diff --git a/buidler.config.js b/buidler.config.js new file mode 100644 index 0000000..f618ed9 --- /dev/null +++ b/buidler.config.js @@ -0,0 +1,154 @@ +// Libraries +const assert = require("assert"); +const { utils } = require("ethers"); + +const GelatoCoreLib = require("@gelatonetwork/core"); + +// Process Env Variables +require("dotenv").config(); +const INFURA_ID = process.env.INFURA_ID; +assert.ok(INFURA_ID, "no Infura ID in process.env"); + +const INSTA_MASTER = "0xfCD22438AD6eD564a1C26151Df73F6B33B817B56"; + +// ================================= CONFIG ========================================= +module.exports = { + defaultNetwork: "ganache", + networks: { + ganache: { + // Standard config + url: "http://localhost:8545", + fork: `https://mainnet.infura.io/v3/${INFURA_ID}`, + unlocked_accounts: [INSTA_MASTER], + // Custom + GelatoCore: "0x1d681d76ce96E4d70a88A00EBbcfc1E47808d0b8", + InstaMaster: INSTA_MASTER, + InstaIndex: "0x2971AdFa57b20E5a416aE5a708A8655A9c74f723", + InstaList: "0x4c8a1BEb8a87765788946D6B19C6C6355194AbEb", + InstaConnectors: "0xD6A602C01a023B98Ecfb29Df02FBA380d3B21E0c", + InstaAccount: "0x939Daad09fC4A9B8f8A9352A485DAb2df4F4B3F8", + ConnectAuth: "0xd1aFf9f2aCf800C876c409100D6F39AEa93Fc3D9", + ConnectBasic: "0x6a31c5982C5Bc5533432913cf06a66b6D3333a95", + ConnectMaker: "0xac02030d8a8F49eD04b2f52C394D3F901A10F8A9", + ConnectCompound: "0x07F81230d73a78f63F0c2A3403AD281b067d28F8", + DAI: "0x6b175474e89094c44da98b954eedeac495271d0f", + DAI_UNISWAP: "0x2a1530C4C41db0B0b2bB646CB5Eb1A67b7158667", + }, + }, + solc: { + version: "0.6.12", + optimizer: { enabled: true }, + }, +}; + +// ================================= PLUGINS ========================================= +usePlugin("@nomiclabs/buidler-ethers"); +usePlugin("@nomiclabs/buidler-ganache"); +usePlugin("@nomiclabs/buidler-waffle"); + +// ================================= TASKS ========================================= +task("abi-encode-withselector") + .addPositionalParam( + "abi", + "Contract ABI in array form", + undefined, + types.json + ) + .addPositionalParam("functionname") + .addOptionalVariadicPositionalParam( + "inputs", + "Array of function params", + undefined, + types.json + ) + .addFlag("log") + .setAction(async (taskArgs) => { + try { + if (taskArgs.log) console.log(taskArgs); + + if (!taskArgs.abi) + throw new Error("abi-encode-withselector: no abi passed"); + + const interFace = new utils.Interface(taskArgs.abi); + + let functionFragment; + try { + functionFragment = interFace.getFunction(taskArgs.functionname); + } catch (error) { + throw new Error( + `\n ❌ abi-encode-withselector: functionname "${taskArgs.functionname}" not found` + ); + } + + let payloadWithSelector; + + if (taskArgs.inputs) { + let iterableInputs; + try { + iterableInputs = [...taskArgs.inputs]; + } catch (error) { + iterableInputs = [taskArgs.inputs]; + } + payloadWithSelector = interFace.encodeFunctionData( + functionFragment, + iterableInputs + ); + } else { + payloadWithSelector = interFace.encodeFunctionData( + functionFragment, + [] + ); + } + + if (taskArgs.log) + console.log(`\nEncodedPayloadWithSelector:\n${payloadWithSelector}\n`); + return payloadWithSelector; + } catch (err) { + console.error(err); + process.exit(1); + } + }); + +task( + "fetchGelatoGasPrice", + `Returns the current gelato gas price used for calling canExec and exec` +) + .addOptionalParam("gelatocoreaddress") + .addFlag("log", "Logs return values to stdout") + .setAction(async (taskArgs) => { + try { + const gelatoCore = await ethers.getContractAt( + GelatoCoreLib.GelatoCore.abi, + taskArgs.gelatocoreaddress + ? taskArgs.gelatocoreaddress + : network.config.GelatoCore + ); + + const oracleAbi = ["function latestAnswer() view returns (int256)"]; + + const gelatoGasPriceOracleAddress = await gelatoCore.gelatoGasPriceOracle(); + + // Get gelatoGasPriceOracleAddress + const gelatoGasPriceOracle = await ethers.getContractAt( + oracleAbi, + gelatoGasPriceOracleAddress + ); + + // lastAnswer is used by GelatoGasPriceOracle as well as the Chainlink Oracle + const gelatoGasPrice = await gelatoGasPriceOracle.latestAnswer(); + + if (taskArgs.log) { + console.log( + `\ngelatoGasPrice: ${utils.formatUnits( + gelatoGasPrice.toString(), + "gwei" + )} gwei\n` + ); + } + + return gelatoGasPrice; + } catch (error) { + console.error(error, "\n"); + process.exit(1); + } + }); diff --git a/contracts/ConditionCompareUintsFromTwoSources.sol b/contracts/ConditionCompareUintsFromTwoSources.sol new file mode 100644 index 0000000..36baaac --- /dev/null +++ b/contracts/ConditionCompareUintsFromTwoSources.sol @@ -0,0 +1,102 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; + +import { + GelatoConditionsStandard +} from "@gelatonetwork/core/contracts/conditions/GelatoConditionsStandard.sol"; +import {SafeMath} from "@gelatonetwork/core/contracts/external/SafeMath.sol"; +import {IERC20} from "@gelatonetwork/core/contracts/external/IERC20.sol"; +import { + IGelatoCore +} from "@gelatonetwork/core/contracts/gelato_core/interfaces/IGelatoCore.sol"; +import {GelatoBytes} from "./GelatoBytes.sol"; + +/// @notice A general contract for retrieving and comparing 2 uints from 2 contracts. +/// @dev This contract only works if the refContracts fns returndata has a uint in +/// the first 32-byte position. +contract ConditionCompareUintsFromTwoSources is GelatoConditionsStandard { + using GelatoBytes for bytes; + using SafeMath for uint256; + + /// @notice Helper to encode the Condition data field off-chain + function getConditionData( + address _sourceA, + address _sourceB, + bytes calldata _sourceAData, + bytes calldata _sourceBData, + uint256 _minSpread + ) + public + pure + virtual + returns (bytes memory) + { + return abi.encode(_sourceA, _sourceB, _sourceAData, _sourceBData, _minSpread); + } + + /// @notice Gelato Standard Condition function. + /// @dev Every Gelato Condition must have this function selector as entry point. + /// @param _conditionData The encoded data from getConditionData() + function ok(uint256, bytes calldata _conditionData, uint256) + public + view + virtual + override + returns (string memory) + { + (address _sourceA, + address _sourceB, + bytes memory _sourceAData, + bytes memory _sourceBData, + uint256 _minSpread) = abi.decode( + _conditionData, + (address,address,bytes,bytes,uint256) + ); + return compare(_sourceA, _sourceB, _sourceAData, _sourceBData, _minSpread); + } + + /// @notice Compares 2 values from sourceA and sourceB to check if minSpread is there. + /// @dev If you want to trigger when ContractA uint is greater than or equal + /// to ContractB by _minSpread: (ContractA=_sourceA, ContractB=_sourceB) + /// For the reverse (lower than/equal to): (ContractA=_sourceB, ContractB=_sourceA) + /// @param _sourceA The first contract that returns a uint for comparison. + /// @param _sourceB The second contract that returns a uint256 for comparison. + /// @param _sourceAData Payload for retrieving the uint from _sourceA. + /// @param _sourceBData Payload for retrieving the uint from _sourceB. + /// @param _minSpread The minimum diff between sourceA and sourceB + /// for the Condition to be relevant. + /// @return OK if the Condition is fulfilled. + function compare( + address _sourceA, + address _sourceB, + bytes memory _sourceAData, + bytes memory _sourceBData, + uint256 _minSpread + ) + public + view + virtual + returns (string memory) + { + // Retrieve uint256 from sourceA + (bool success, bytes memory returndata) = _sourceA.staticcall(_sourceAData); + if (!success) { + return returndata.generateErrorString( + "ConditionCompareTwoUints.compare._sourceA:" + ); + } + uint256 a = abi.decode(returndata, (uint256)); + + // Retrieve uint256 from sourceB + (success, returndata) = _sourceB.staticcall(_sourceBData); + if (!success) { + return returndata.generateErrorString( + "ConditionCompareTwoUints.compare._sourceB:" + ); + } + uint256 b = abi.decode(returndata, (uint256)); + + if (a >= b.add(_minSpread)) return OK; + return "ANotGreaterOrEqualToBbyMinspread"; + } +} \ No newline at end of file diff --git a/contracts/ConditionHasBalanceAndAllowance.sol b/contracts/ConditionHasBalanceAndAllowance.sol new file mode 100644 index 0000000..0f1e70b --- /dev/null +++ b/contracts/ConditionHasBalanceAndAllowance.sol @@ -0,0 +1,75 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import { + GelatoConditionsStandard +} from "@gelatonetwork/core/contracts/conditions/GelatoConditionsStandard.sol"; +import {IERC20} from "@gelatonetwork/core/contracts/external/IERC20.sol"; + +contract ConditionHasBalanceAndAllowance is GelatoConditionsStandard { + + /// @dev Use this function to encode the data off-chain for the condition data field + /// @param _token The token whose balance and allowance we check. + /// 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for ETH. + /// @param _from The account whose balance to check + /// @param _to The account whose allowance to check. AddressZero for ETH. + /// @param _value The balance/allowance that needs to be present at least. + /// @return abi encoded params (without selector) + function getConditionData( + address _token, + address _from, + address _to, + uint256 _value + ) + public + pure + virtual + returns(bytes memory) + { + return abi.encode(_from, _to, _token, _value); + } + + /// @param _conditionData The encoded data from getConditionData() + function ok(uint256, bytes calldata _conditionData, uint256) + public + view + virtual + override + returns(string memory) + { + (address _token, + address _from, + address _to, + uint256 _value) = abi.decode(_conditionData, (address,address,address,uint256)); + return check(_token, _from, _to, _value); + } + + // Specific Implementation + function check(address _token, address _from, address _to, uint256 _value) + public + view + virtual + returns(string memory) + { + // ETH balance + if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) { + if (_from.balance >= _value) return OK; + return "NotOkETHBalance"; + } else { + // ERC20 balance and allowance + IERC20 erc20 = IERC20(_token); + try erc20.balanceOf(_from) returns (uint256 balance) { + if (balance < _value) return "NotOkERC20Balance"; + } catch { + return "ERC20BalanceError"; + } + try erc20.allowance(_from, _to) returns (uint256 allowance) { + if (allowance >= _value) return OK; + return "NotOkERC20Allowance"; + } catch { + return "ERC20AllowanceError"; + } + } + } +} \ No newline at end of file diff --git a/contracts/ConnectGelato.sol b/contracts/ConnectGelato.sol new file mode 100644 index 0000000..b35929d --- /dev/null +++ b/contracts/ConnectGelato.sol @@ -0,0 +1,136 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import { + IGelatoCore, + Provider, + Task, + TaskReceipt +} from "@gelatonetwork/core/contracts/gelato_core/interfaces/IGelatoCore.sol"; +import { + IGelatoProviders, + TaskSpec +} from "@gelatonetwork/core/contracts/gelato_core/interfaces/IGelatoProviders.sol"; +import { + IGelatoProviderModule +} from "@gelatonetwork/core/contracts/provider_modules/IGelatoProviderModule.sol"; +import {Address} from "@gelatonetwork/core/contracts/external/Address.sol"; +import {SafeMath} from "@gelatonetwork/core/contracts/external/SafeMath.sol"; + +interface ConnectorInterface { + function connectorID() external view returns(uint _type, uint _id); + function name() external pure returns (string memory); +} + +/// @title ConnectGelato +/// @notice Allows InstaDapp DSA to enter and exit Gelato Network +/// @author gitpusha +contract ConnectGelato is ConnectorInterface { + + using Address for address payable; + using SafeMath for uint256; + + string constant public override name = "ConnectGelato-v1"; + + address public immutable connectGelatoAddress; + uint256 public immutable id; + address public immutable gelatoCore; + + constructor(uint256 _id, address _gelatoCore) public payable { + connectGelatoAddress = address(this); + id = _id; + gelatoCore = _gelatoCore; + } + + /// @dev needed for unproviding funds from GelatoCore + receive() external payable { + require(msg.sender == gelatoCore, "ConnectGelato.receive"); + } + + /// @dev _id must be InstaConnectors.connectorLength+1 + function connectorID() external view override returns(uint _type, uint _id) { + (_type, _id) = (1, id); + } + + modifier delegatecallOnly(string memory _tracingInfo) { + require( + connectGelatoAddress != address(this), + string(abi.encodePacked(_tracingInfo, ":delegatecallOnly")) + ); + _; + } + + // ===== Gelato ENTRY APIs ====== + function multiProvide( + address _executor, + TaskSpec[] calldata _taskSpecs, + IGelatoProviderModule[] calldata _modules + ) + external + payable + delegatecallOnly("ConnectGelato.multiProvide") + { + try IGelatoProviders(gelatoCore).multiProvide{value: msg.value}( + _executor, + _taskSpecs, + _modules + ) { + } catch Error(string memory error) { + revert(string(abi.encodePacked("ConnectGelato.multiProvide:", error))); + } catch { + revert("ConnectGelato.multiProvide: unknown error"); + } + } + + function submitTask( + Provider calldata _provider, + Task calldata _task, + uint256 _expiryDate + ) + external + delegatecallOnly("ConnectGelato.submitTask") + { + try IGelatoCore(gelatoCore).submitTask(_provider, _task, _expiryDate) { + } catch Error(string memory error) { + revert(string(abi.encodePacked("ConnectGelato.submitTask:", error))); + } catch { + revert("ConnectGelato.submitTask: unknown error"); + } + } + + // ===== Gelato EXIT APIs ====== + function multiUnprovide( + uint256 _withdrawAmount, + TaskSpec[] memory _taskSpecs, + IGelatoProviderModule[] memory _modules + ) + external + delegatecallOnly("ConnectGelato.multiUnprovide") + { + uint256 balanceBefore = address(this).balance; + try IGelatoProviders(gelatoCore).multiUnprovide( + _withdrawAmount, + _taskSpecs, + _modules + ) { + msg.sender.sendValue(address(this).balance.sub(balanceBefore)); + } catch Error(string memory error) { + revert(string(abi.encodePacked("ConnectGelato.multiUnprovide:", error))); + } catch { + revert("ConnectGelato.multiUnprovide: unknown error"); + } + } + + function multiCancelTasks(TaskReceipt[] calldata _taskReceipts) + external + delegatecallOnly("ConnectGelato.multiCancelTasks") + { + try IGelatoCore(gelatoCore).multiCancelTasks(_taskReceipts) { + } catch Error(string memory error) { + revert(string(abi.encodePacked("ConnectGelato.multiCancelTasks:", error))); + } catch { + revert("ConnectGelato.multiCancelTasks: unknown error"); + } + } +} \ No newline at end of file diff --git a/contracts/GelatoBytes.sol b/contracts/GelatoBytes.sol new file mode 100644 index 0000000..0736778 --- /dev/null +++ b/contracts/GelatoBytes.sol @@ -0,0 +1,67 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; + +library GelatoBytes { + function calldataSliceSelector(bytes calldata _bytes) + internal + pure + returns (bytes4 selector) + { + selector = + _bytes[0] | + (bytes4(_bytes[1]) >> 8) | + (bytes4(_bytes[2]) >> 16) | + (bytes4(_bytes[3]) >> 24); + } + + function memorySliceSelector(bytes memory _bytes) + internal + pure + returns (bytes4 selector) + { + selector = + _bytes[0] | + (bytes4(_bytes[1]) >> 8) | + (bytes4(_bytes[2]) >> 16) | + (bytes4(_bytes[3]) >> 24); + } + + function revertWithErrorString(bytes memory _bytes, string memory _tracingInfo) + internal + pure + { + // 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err + if (_bytes.length % 32 == 4) { + bytes4 selector; + assembly { selector := mload(add(0x20, _bytes)) } + if (selector == 0x08c379a0) { // Function selector for Error(string) + assembly { _bytes := add(_bytes, 68) } + revert(string(abi.encodePacked(_tracingInfo, string(_bytes)))); + } else { + revert(string(abi.encodePacked(_tracingInfo, "NoErrorSelector"))); + } + } else { + revert(string(abi.encodePacked(_tracingInfo, "UnexpectedReturndata"))); + } + } + + function generateErrorString(bytes memory _bytes, string memory _tracingInfo) + internal + pure + returns (string memory) + { + // 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err + if (_bytes.length % 32 == 4) { + bytes4 selector; + assembly { selector := mload(add(0x20, _bytes)) } + if (selector == 0x08c379a0) { // Function selector for Error(string) + assembly { _bytes := add(_bytes, 68) } + return string(abi.encodePacked(_tracingInfo, string(_bytes))); + } else { + return string(abi.encodePacked(_tracingInfo, "NoErrorSelector")); + } + } else { + return string(abi.encodePacked(_tracingInfo, "UnexpectedReturndata")); + } + } +} \ No newline at end of file diff --git a/contracts/MockCDAI.sol b/contracts/MockCDAI.sol new file mode 100644 index 0000000..9446371 --- /dev/null +++ b/contracts/MockCDAI.sol @@ -0,0 +1,17 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; + +contract MockCDAI { + // DSR + // https://compound.finance/docs#protocol-math + // CDAI uses supplyRatePerBlock with 10**18 precision + // Because MakerDAO dsr is rate per second with 10**27 precision, + // we also adopt this for CDAI. + uint256 public supplyRatePerSecond = 1000000000627937192491029810; // per second==2% annually + + /// @dev Use this during tests to simulate changing CDAI.supplyRatePerBlock conditions + /// @param _rate CDAI.supplyRatePerBlock but in seconds and 10**27 precision + function setSupplyRatePerSecond(uint256 _rate) external virtual { + supplyRatePerSecond = _rate; + } +} \ No newline at end of file diff --git a/contracts/MockDSR.sol b/contracts/MockDSR.sol new file mode 100644 index 0000000..79783cb --- /dev/null +++ b/contracts/MockDSR.sol @@ -0,0 +1,19 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; + +contract MockDSR { + // DSR + // https://github.com/makerdao/dss/blob/master/src/pot.sol + // https://docs.makerdao.com/smart-contract-modules/rates-module#a-note-on-setting-rates + // - is the rate per second + // - can be set by Maker governance on the Pot contract in the RatesModule. + // - returns annual percentage value as 10**27 [ray] + // - e.g. dsr=1000000000627937192491029810 == 2 % annually + uint256 public dsr = 1000000000627937192491029810; // per second==2% annually + + /// @dev Use this during tests to simulate changing DSR conditions + /// @param _dsr The dsr to set. + function setDSR(uint256 _dsr) external virtual { + dsr = _dsr; + } +} \ No newline at end of file diff --git a/contracts/ProviderModuleDSA.sol b/contracts/ProviderModuleDSA.sol new file mode 100644 index 0000000..9081d6c --- /dev/null +++ b/contracts/ProviderModuleDSA.sol @@ -0,0 +1,104 @@ +// "SPDX-License-Identifier: UNLICENSED" +pragma solidity 0.6.12; +pragma experimental ABIEncoderV2; + +import { + GelatoProviderModuleStandard +} from "@gelatonetwork/core/contracts/provider_modules/GelatoProviderModuleStandard.sol"; +import {Task} from "@gelatonetwork/core/contracts/gelato_core/interfaces/IGelatoCore.sol"; + +/// @dev InstaDapp Index +interface IndexInterface { + function connectors(uint version) external view returns (address); + function list() external view returns (address); +} + +/// @dev InstaDapp List +interface ListInterface { + function accountID(address _account) external view returns (uint64); +} + +/// @dev InstaDapp Connectors +interface ConnectorsInterface { + function isConnector(address[] calldata logicAddr) external view returns (bool); + function isStaticConnector(address[] calldata logicAddr) external view returns (bool); +} + +/// @dev InstaDapp Defi Smart Account wallet +interface AccountInterface { + function version() external view returns (uint); + function isAuth(address user) external view returns (bool); + function shield() external view returns (bool); + function cast(address[] calldata _targets, bytes[] calldata _datas, address _origin) + external + payable + returns (bytes32[] memory responses); +} + +contract ProviderModuleDSA is GelatoProviderModuleStandard { + IndexInterface public immutable index; + address public immutable gelatoCore; + + constructor(IndexInterface _index, address _gelatoCore) public { + index = _index; + gelatoCore = _gelatoCore; + } + + // ================= GELATO PROVIDER MODULE STANDARD ================ + function isProvided(address _userProxy, address, Task calldata _task) + external + view + override + returns(string memory) + { + // Verify InstaDapp account identity + if (ListInterface(index.list()).accountID(_userProxy) == 0) + return "ProviderModuleDSA.isProvided:InvalidUserProxy"; + + // Is GelatoCore authorized + if (!AccountInterface(_userProxy).isAuth(gelatoCore)) + return "ProviderModuleDSA.isProvided:GelatoCoreNotAuth"; + + // Is connector valid + ConnectorsInterface connectors = ConnectorsInterface(index.connectors( + AccountInterface(_userProxy).version() + )); + + address[] memory targets = new address[](_task.actions.length); + for (uint i = 0; i < _task.actions.length; i++) + targets[i] = _task.actions[i].addr; + + bool isShield = AccountInterface(_userProxy).shield(); + if (isShield) + if (!connectors.isStaticConnector(targets)) + return "ProviderModuleDSA.isProvided:not-static-connector"; + else + if (!connectors.isConnector(targets)) + return "ProviderModuleDSA.isProvided:not-connector"; + + return OK; + } + + /// @dev DS PROXY ONLY ALLOWS DELEGATE CALL for single actions, that's why we also use multisend + function execPayload(uint256, address, address, Task calldata _task, uint256) + external + view + override + returns(bytes memory payload, bool) + { + address[] memory targets = new address[](_task.actions.length); + for (uint i = 0; i < _task.actions.length; i++) + targets[i] = _task.actions[i].addr; + + bytes[] memory datas = new bytes[](_task.actions.length); + for (uint i = 0; i < _task.actions.length; i++) + datas[i] = _task.actions[i].data; + + payload = abi.encodeWithSelector( + AccountInterface.cast.selector, + targets, + datas, + tx.origin + ); + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..a784ddd --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "gelato-instadapp", + "version": "1.0.0", + "description": "The smart contract and tests for automatic CHI token buying", + "repository": "https://github.com/gelatodigital/gelato-instadapp", + "author": "gitpusha", + "private": false, + "scripts": {}, + "devDependencies": { + "@gelatonetwork/core": "0.5.3", + "@nomiclabs/buidler": "1.4.3", + "@nomiclabs/buidler-ethers": "2.0.0", + "@nomiclabs/buidler-ganache": "^1.3.3", + "@nomiclabs/buidler-waffle": "2.0.0", + "chai": "^4.2.0", + "dotenv": "8.2.0", + "ethereum-waffle": "3.0.2", + "ethers": "5.0.8", + "prettier": "2.0.5" + }, + "dependencies": {} +} diff --git a/pre-compiles/ConnectAuth.json b/pre-compiles/ConnectAuth.json new file mode 100644 index 0000000..6f72cb1 --- /dev/null +++ b/pre-compiles/ConnectAuth.json @@ -0,0 +1,104 @@ +{ + "contractName": "ConnectAuth", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_msgSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "LogAddAuth", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_msgSender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_authority", + "type": "address" + } + ], + "name": "LogRemoveAuth", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "add", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "connectorID", + "outputs": [ + { + "internalType": "uint256", + "name": "_type", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "authority", + "type": "address" + } + ], + "name": "remove", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b5061047f806100206000396000f3fe60806040526004361061003f5760003560e01c806306fdde03146100445780630a3b0a4f146100ce57806329092d0e146100f6578063eb15f7811461011c575b600080fd5b34801561005057600080fd5b5061005961014a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561009357818101518382015260200161007b565b50505050905090810190601f1680156100c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100f4600480360360208110156100e457600080fd5b50356001600160a01b031661016d565b005b6100f46004803603602081101561010c57600080fd5b50356001600160a01b0316610342565b34801561012857600080fd5b50610131610429565b6040805192835260208301919091528051918290030190f35b60405180604001604052806007815260200166417574682d763160c81b81525081565b60408051630b7f436d60e31b81526001600160a01b038316600482015290513091635bfa1b6891602480830192600092919082900301818387803b1580156101b457600080fd5b505af11580156101c8573d6000803e3d6000fd5b50506040516001600160a01b03841692503391507f0a0883e359d023e38c8befc2b894f838c1942537ae51cba71e2bc651af2b3a5d90600090a3604080513360208201526001600160a01b0383168183015281518082038301815260609091019091527f0a0883e359d023e38c8befc2b894f838c1942537ae51cba71e2bc651af2b3a5d90600080610258610429565b91509150610264610431565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156102d45781810151838201526020016102bc565b50505050905090810190601f1680156103015780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561032357600080fd5b505af1158015610337573d6000803e3d6000fd5b505050505050505050565b6040805163e6c09edf60e01b81526001600160a01b03831660048201529051309163e6c09edf91602480830192600092919082900301818387803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b50506040516001600160a01b03841692503391507f7289d07acd866f85ba9176bdbac8304ca6072c00bde3d94c43afd8fbc8114db890600090a3604080513360208201526001600160a01b0383168183015281518082038301815260609091019091527f7289d07acd866f85ba9176bdbac8304ca6072c00bde3d94c43afd8fbc8114db8906000806102585b600190600a90565b732af7ea6cb911035f3eb1ed895cb6692c39ecba979056fea2646970667358221220aaff9fce38c2adc6ce77e28826e95d8fa2b77e60224b45f4f0215bb6478057c164736f6c634300060c0033", + "deployedBytecode": "0x60806040526004361061003f5760003560e01c806306fdde03146100445780630a3b0a4f146100ce57806329092d0e146100f6578063eb15f7811461011c575b600080fd5b34801561005057600080fd5b5061005961014a565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561009357818101518382015260200161007b565b50505050905090810190601f1680156100c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100f4600480360360208110156100e457600080fd5b50356001600160a01b031661016d565b005b6100f46004803603602081101561010c57600080fd5b50356001600160a01b0316610342565b34801561012857600080fd5b50610131610429565b6040805192835260208301919091528051918290030190f35b60405180604001604052806007815260200166417574682d763160c81b81525081565b60408051630b7f436d60e31b81526001600160a01b038316600482015290513091635bfa1b6891602480830192600092919082900301818387803b1580156101b457600080fd5b505af11580156101c8573d6000803e3d6000fd5b50506040516001600160a01b03841692503391507f0a0883e359d023e38c8befc2b894f838c1942537ae51cba71e2bc651af2b3a5d90600090a3604080513360208201526001600160a01b0383168183015281518082038301815260609091019091527f0a0883e359d023e38c8befc2b894f838c1942537ae51cba71e2bc651af2b3a5d90600080610258610429565b91509150610264610431565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156102d45781810151838201526020016102bc565b50505050905090810190601f1680156103015780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561032357600080fd5b505af1158015610337573d6000803e3d6000fd5b505050505050505050565b6040805163e6c09edf60e01b81526001600160a01b03831660048201529051309163e6c09edf91602480830192600092919082900301818387803b15801561038957600080fd5b505af115801561039d573d6000803e3d6000fd5b50506040516001600160a01b03841692503391507f7289d07acd866f85ba9176bdbac8304ca6072c00bde3d94c43afd8fbc8114db890600090a3604080513360208201526001600160a01b0383168183015281518082038301815260609091019091527f7289d07acd866f85ba9176bdbac8304ca6072c00bde3d94c43afd8fbc8114db8906000806102585b600190600a90565b732af7ea6cb911035f3eb1ed895cb6692c39ecba979056fea2646970667358221220aaff9fce38c2adc6ce77e28826e95d8fa2b77e60224b45f4f0215bb6478057c164736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/ConnectBasic.json b/pre-compiles/ConnectBasic.json new file mode 100644 index 0000000..27fe7a4 --- /dev/null +++ b/pre-compiles/ConnectBasic.json @@ -0,0 +1,169 @@ +{ + "contractName": "ConnectBasic", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "erc20", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "erc20", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogWithdraw", + "type": "event" + }, + { + "inputs": [], + "name": "connectorID", + "outputs": [ + { + "internalType": "uint256", + "name": "model", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "id", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "erc20", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "erc20", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610c30806100206000396000f3fe60806040526004361061003f5760003560e01c806306fdde03146100445780634bd3ab82146100ce578063ce88b43914610110578063eb15f78114610148575b600080fd5b34801561005057600080fd5b50610059610176565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561009357818101518382015260200161007b565b50505050905090810190601f1680156100c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61010e600480360360a08110156100e457600080fd5b506001600160a01b038135811691602081013591604082013516906060810135906080013561019c565b005b61010e6004803603608081101561012657600080fd5b506001600160a01b038135169060208101359060408101359060600135610440565b34801561015457600080fd5b5061015d61062d565b6040805192835260208301919091528051918290030190f35b6040518060400160405280600a81526020016942617369632d76312e3160b01b81525081565b60408051632520e7ff60e01b81526001600160a01b038516600482015290513091632520e7ff916024808301926020929190829003018186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d602081101561020c57600080fd5b5051610254576040805162461bcd60e51b8152602060048201526012602482015271696e76616c69642d746f2d6164647265737360701b604482015290519081900360640190fd5b60006102608386610634565b905061026a6106c3565b6001600160a01b0316866001600160a01b031614156102d35760001981146102925780610294565b475b6040519091506001600160a01b0385169082156108fc029083906000818181858888f193505050501580156102cd573d6000803e3d6000fd5b5061036e565b8560001982146102e35781610356565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561032957600080fd5b505afa15801561033d573d6000803e3d6000fd5b505050506040513d602081101561035357600080fd5b50515b915061036c6001600160a01b03821686846106db565b505b6103788282610732565b604080518281526020810185905280820184905290516001600160a01b0380871692908916917fbda29dc1242153445159457be3dc12cdc3b4ca777000c536f8a42078b029672d9181900360600190a3604080516001600160a01b038089166020830152818301849052861660608201526080810185905260a08082018590528251808303909101815260c09091019091527fbda29dc1242153445159457be3dc12cdc3b4ca777000c536f8a42078b029672d9061043682826107aa565b5050505050505050565b600061044c8385610634565b90506104566106c3565b6001600160a01b0316856001600160a01b03161461050e5784600019821461047e57816104f1565b604080516370a0823160e01b815233600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50515b91506105086001600160a01b038216333085610894565b50610568565b8034148061051d575060001981145b610565576040805162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a590b595d1a195c8b585b5bdd5b9d60621b604482015290519081900360640190fd5b50345b6105728282610732565b604080518281526020810185905280820184905290516001600160a01b038716917f4b2bcb0ca50531683faa51870e1018aa0d7272c7f2acc5399389b0c0493865d9919081900360600190a2604080516001600160a01b03871660208201528082018390526060810185905260808082018590528251808303909101815260a09091019091527f4b2bcb0ca50531683faa51870e1018aa0d7272c7f2acc5399389b0c0493865d99061062482826107aa565b50505050505050565b6000908190565b600082156106ba576106446108f4565b6001600160a01b031663a9c70eaa846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561068957600080fd5b505af115801561069d573d6000803e3d6000fd5b505050506040513d60208110156106b357600080fd5b50516106bc565b815b9392505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261072d90849061090c565b505050565b81156107a6576107406108f4565b6001600160a01b03166361e3c94483836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561078d57600080fd5b505af11580156107a1573d6000803e3d6000fd5b505050505b5050565b6000806107b561062d565b915091506107c16109bd565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610831578181015183820152602001610819565b50505050905090810190601f16801561085e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561088057600080fd5b505af1158015610436573d6000803e3d6000fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526108ee90859061090c565b50505050565b738a5419cfc711b2343c17a6abf4b2bafabb06957f90565b6060610961826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109d59092919063ffffffff16565b80519091501561072d5780806020019051602081101561098057600080fd5b505161072d5760405162461bcd60e51b815260040180806020018281038252602a815260200180610bd1602a913960400191505060405180910390fd5b732af7ea6cb911035f3eb1ed895cb6692c39ecba9790565b60606109e484846000856109ec565b949350505050565b60606109f785610b97565b610a48576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610a875780518252601f199092019160209182019101610a68565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610ae9576040519150601f19603f3d011682016040523d82523d6000602084013e610aee565b606091505b50915091508115610b025791506109e49050565b805115610b125780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b5c578181015183820152602001610b44565b50505050905090810190601f168015610b895780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906109e457505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220548f6fdde99dbd63ec174e3c1bbbbe4f5f4a2229d96d0229d8913c47991f122464736f6c634300060c0033", + "deployedBytecode": "0x60806040526004361061003f5760003560e01c806306fdde03146100445780634bd3ab82146100ce578063ce88b43914610110578063eb15f78114610148575b600080fd5b34801561005057600080fd5b50610059610176565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561009357818101518382015260200161007b565b50505050905090810190601f1680156100c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61010e600480360360a08110156100e457600080fd5b506001600160a01b038135811691602081013591604082013516906060810135906080013561019c565b005b61010e6004803603608081101561012657600080fd5b506001600160a01b038135169060208101359060408101359060600135610440565b34801561015457600080fd5b5061015d61062d565b6040805192835260208301919091528051918290030190f35b6040518060400160405280600a81526020016942617369632d76312e3160b01b81525081565b60408051632520e7ff60e01b81526001600160a01b038516600482015290513091632520e7ff916024808301926020929190829003018186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d602081101561020c57600080fd5b5051610254576040805162461bcd60e51b8152602060048201526012602482015271696e76616c69642d746f2d6164647265737360701b604482015290519081900360640190fd5b60006102608386610634565b905061026a6106c3565b6001600160a01b0316866001600160a01b031614156102d35760001981146102925780610294565b475b6040519091506001600160a01b0385169082156108fc029083906000818181858888f193505050501580156102cd573d6000803e3d6000fd5b5061036e565b8560001982146102e35781610356565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561032957600080fd5b505afa15801561033d573d6000803e3d6000fd5b505050506040513d602081101561035357600080fd5b50515b915061036c6001600160a01b03821686846106db565b505b6103788282610732565b604080518281526020810185905280820184905290516001600160a01b0380871692908916917fbda29dc1242153445159457be3dc12cdc3b4ca777000c536f8a42078b029672d9181900360600190a3604080516001600160a01b038089166020830152818301849052861660608201526080810185905260a08082018590528251808303909101815260c09091019091527fbda29dc1242153445159457be3dc12cdc3b4ca777000c536f8a42078b029672d9061043682826107aa565b5050505050505050565b600061044c8385610634565b90506104566106c3565b6001600160a01b0316856001600160a01b03161461050e5784600019821461047e57816104f1565b604080516370a0823160e01b815233600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b1580156104c457600080fd5b505afa1580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50515b91506105086001600160a01b038216333085610894565b50610568565b8034148061051d575060001981145b610565576040805162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a590b595d1a195c8b585b5bdd5b9d60621b604482015290519081900360640190fd5b50345b6105728282610732565b604080518281526020810185905280820184905290516001600160a01b038716917f4b2bcb0ca50531683faa51870e1018aa0d7272c7f2acc5399389b0c0493865d9919081900360600190a2604080516001600160a01b03871660208201528082018390526060810185905260808082018590528251808303909101815260a09091019091527f4b2bcb0ca50531683faa51870e1018aa0d7272c7f2acc5399389b0c0493865d99061062482826107aa565b50505050505050565b6000908190565b600082156106ba576106446108f4565b6001600160a01b031663a9c70eaa846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561068957600080fd5b505af115801561069d573d6000803e3d6000fd5b505050506040513d60208110156106b357600080fd5b50516106bc565b815b9392505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261072d90849061090c565b505050565b81156107a6576107406108f4565b6001600160a01b03166361e3c94483836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b15801561078d57600080fd5b505af11580156107a1573d6000803e3d6000fd5b505050505b5050565b6000806107b561062d565b915091506107c16109bd565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610831578181015183820152602001610819565b50505050905090810190601f16801561085e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561088057600080fd5b505af1158015610436573d6000803e3d6000fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526108ee90859061090c565b50505050565b738a5419cfc711b2343c17a6abf4b2bafabb06957f90565b6060610961826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109d59092919063ffffffff16565b80519091501561072d5780806020019051602081101561098057600080fd5b505161072d5760405162461bcd60e51b815260040180806020018281038252602a815260200180610bd1602a913960400191505060405180910390fd5b732af7ea6cb911035f3eb1ed895cb6692c39ecba9790565b60606109e484846000856109ec565b949350505050565b60606109f785610b97565b610a48576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310610a875780518252601f199092019160209182019101610a68565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610ae9576040519150601f19603f3d011682016040523d82523d6000602084013e610aee565b606091505b50915091508115610b025791506109e49050565b805115610b125780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b5c578181015183820152602001610b44565b50505050905090810190601f168015610b895780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906109e457505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220548f6fdde99dbd63ec174e3c1bbbbe4f5f4a2229d96d0229d8913c47991f122464736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/ConnectCompound.json b/pre-compiles/ConnectCompound.json new file mode 100644 index 0000000..051aae3 --- /dev/null +++ b/pre-compiles/ConnectCompound.json @@ -0,0 +1,549 @@ +{ + "contractName": "ConnectCompound", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "compAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogClaimedComp", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cTokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogDepositCToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenToPay", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenInReturn", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogLiquidate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogPayback", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "cToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "cTokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogWithdrawCToken", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "ClaimComp", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "connectorID", + "outputs": [ + { + "internalType": "uint256", + "name": "_type", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "depositCToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "borrower", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenToPay", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenInReturn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "liquidate", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "payback", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cTokenAmt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "withdrawCToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x60c0604052600d60808190526c21b7b6b837bab73216bb18971960991b60a090815262000030916000919062000045565b503480156200003e57600080fd5b50620000e1565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200008857805160ff1916838001178555620000b8565b82800160010185558215620000b8579182015b82811115620000b85782518255916020019190600101906200009b565b50620000c6929150620000ca565b5090565b5b80821115620000c65760008155600101620000cb565b612bf980620000f16000396000f3fe6080604052600436106100915760003560e01c8063a33d406f11610059578063a33d406f146101e7578063b6528b791461021f578063c3233d6114610257578063ce88b4391461029f578063eb15f781146102d757610091565b806306fdde03146100965780632cee00f41461012057806338baa4c21461015a5780634532d77614610192578063943e45a7146101ca575b600080fd5b3480156100a257600080fd5b506100ab610305565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100e55781810151838201526020016100cd565b50505050905090810190601f1680156101125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101586004803603608081101561013657600080fd5b506001600160a01b038135169060208101359060408101359060600135610393565b005b6101586004803603608081101561017057600080fd5b506001600160a01b03813516906020810135906040810135906060013561071c565b610158600480360360808110156101a857600080fd5b506001600160a01b038135169060208101359060408101359060600135610a28565b610158600480360360208110156101e057600080fd5b5035610ecc565b610158600480360360808110156101fd57600080fd5b506001600160a01b0381351690602081013590604081013590606001356111d0565b6101586004803603608081101561023557600080fd5b506001600160a01b038135169060208101359060408101359060600135611658565b610158600480360360c081101561026d57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135611bfb565b610158600480360360808110156102b557600080fd5b506001600160a01b03813516906020810135906040810135906060013561232a565b3480156102e357600080fd5b506102ec6126c6565b6040805192835260208301919091528051918290030190f35b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561038b5780601f106103605761010080835404028352916020019161038b565b820191906000526020600020905b81548152906001019060200180831161036e57829003601f168201915b505050505081565b600061039f83856126ce565b905060006103ab61275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156103f757600080fd5b505afa15801561040b573d6000803e3d6000fd5b505050506040513d602081101561042157600080fd5b5051905080600019831461043557826104a8565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561047b57600080fd5b505afa15801561048f573d6000803e3d6000fd5b505050506040513d60208110156104a557600080fd5b50515b9250806001600160a01b031663db006a75846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156104f057600080fd5b505af1158015610504573d6000803e3d6000fd5b505050506040513d602081101561051a57600080fd5b50511561055e576040805162461bcd60e51b815260206004820152600d60248201526c1c995919595b4b59985a5b1959609a1b604482015290519081900360640190fd5b6105688484612775565b604080516001600160a01b03848116825260208201869052818301889052606082018790529151918916917f076dc1c4fe408b88a32238ee59e09b899084b3ee14bd7f9d0a287a335149070c9181900360800190a2604080516001600160a01b03808a166020830152841681830152606081018590526080810187905260a08082018790528251808303909101815260c09091019091527f076dc1c4fe408b88a32238ee59e09b899084b3ee14bd7f9d0a287a335149070c9060008061062c6126c6565b915091506106386127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156106a8578181015183820152602001610690565b50505050905090810190601f1680156106d55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156106f757600080fd5b505af115801561070b573d6000803e3d6000fd5b505050505050505050505050505050565b600061072883856126ce565b9050600061073461275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561078057600080fd5b505afa158015610794573d6000803e3d6000fd5b505050506040513d60208110156107aa57600080fd5b505190506107b781612805565b806001600160a01b031663c5ebeaec836040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156107fd57600080fd5b505af1158015610811573d6000803e3d6000fd5b505050506040513d602081101561082757600080fd5b50511561086b576040805162461bcd60e51b815260206004820152600d60248201526c189bdc9c9bddcb59985a5b1959609a1b604482015290519081900360640190fd5b6108758383612775565b604080516001600160a01b03838116825260208201859052818301879052606082018690529151918816917f3a5151e57d3bc9798e7853034ac52293d1a0e12a2b44725e75b03b21f86477a69181900360800190a2604080516001600160a01b038089166020830152831681830152606081018490526080810186905260a08082018690528251808303909101815260c09091019091527f3a5151e57d3bc9798e7853034ac52293d1a0e12a2b44725e75b03b21f86477a6906000806109396126c6565b915091506109456127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109b557818101518382015260200161099d565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a0457600080fd5b505af1158015610a18573d6000803e3d6000fd5b5050505050505050505050505050565b6000610a3483856126ce565b90506000610a4061275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d6020811015610ab657600080fd5b5051905080600019831415610d4857866000610ad0612b0d565b6001600160a01b0316896001600160a01b031614610b5f57604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015610b2e57600080fd5b505afa158015610b42573d6000803e3d6000fd5b505050506040513d6020811015610b5857600080fd5b5051610b61565b475b9050826001600160a01b031663db006a75846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610bbf57600080fd5b505afa158015610bd3573d6000803e3d6000fd5b505050506040513d6020811015610be957600080fd5b5051604080516001600160e01b031960e085901b16815260048101929092525160248083019260209291908290030181600087803b158015610c2a57600080fd5b505af1158015610c3e573d6000803e3d6000fd5b505050506040513d6020811015610c5457600080fd5b505115610c9f576040805162461bcd60e51b8152602060048201526014602482015273199d5b1b0b5dda5d1a191c985dcb59985a5b195960621b604482015290519081900360640190fd5b6000610ca9612b0d565b6001600160a01b03168a6001600160a01b031614610d3857604080516370a0823160e01b815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b5051610d3a565b475b919091039450610dfe915050565b806001600160a01b031663852a12e3846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015610d8e57600080fd5b505af1158015610da2573d6000803e3d6000fd5b505050506040513d6020811015610db857600080fd5b505115610dfe576040805162461bcd60e51b815260206004820152600f60248201526e1dda5d1a191c985dcb59985a5b1959608a1b604482015290519081900360640190fd5b610e088484612775565b604080516001600160a01b03848116825260208201869052818301889052606082018790529151918916917facb207402cd2b663d2290a64caab15469bccde82d9c05051581c19189ea246959181900360800190a2604080516001600160a01b03808a166020830152841681830152606081018590526080810187905260a08082018790528251808303909101815260c09091019091527facb207402cd2b663d2290a64caab15469bccde82d9c05051581c19189ea246959060008061062c6126c6565b6000610ed6612b25565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610f2757600080fd5b505afa158015610f3b573d6000803e3d6000fd5b505050506040513d6020811015610f5157600080fd5b50519050610f5d612b3d565b6001600160a01b031663e9af0292306040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610fab57600080fd5b505af1158015610fbf573d6000803e3d6000fd5b505050506000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561101257600080fd5b505afa158015611026573d6000803e3d6000fd5b505050506040513d602081101561103c57600080fd5b50519050600061104c8284612b55565b90506110588582612775565b604080518281526020810187905281517f8f9643cd31938c964bb13e492f388a389da3dd8ac15a32c643356f50454f0114929181900390910190a1604080516020810183905280820187905281518082038301815260609091019091527f8f9643cd31938c964bb13e492f388a389da3dd8ac15a32c643356f50454f0114906000806110e26126c6565b915091506110ee6127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561115e578181015183820152602001611146565b50505050905090810190601f16801561118b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156111ad57600080fd5b505af11580156111c1573d6000803e3d6000fd5b50505050505050505050505050565b60006111dc83856126ce565b905060006111e861275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561123457600080fd5b505afa158015611248573d6000803e3d6000fd5b505050506040513d602081101561125e57600080fd5b5051905080600019831461127257826112e7565b604080516305eff7ef60e21b815230600482015290516001600160a01b038316916317bfdfbc9160248083019260209291908290030181600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506040513d60208110156112e457600080fd5b50515b92506112f1612b0d565b6001600160a01b0316876001600160a01b031614156113a95782471015611350576040805162461bcd60e51b815260206004820152600e60248201526d0dcdee85acadcdeeaced05acae8d60931b604482015290519081900360640190fd5b816001600160a01b0316634e4d9fea846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561138b57600080fd5b505af115801561139f573d6000803e3d6000fd5b505050505061158a565b604080516370a0823160e01b81523060048201529051889185916001600160a01b038416916370a08231916024808301926020929190829003018186803b1580156113f357600080fd5b505afa158015611407573d6000803e3d6000fd5b505050506040513d602081101561141d57600080fd5b50511015611465576040805162461bcd60e51b815260206004820152601060248201526f3737ba16b2b737bab3b416ba37b5b2b760811b604482015290519081900360640190fd5b806001600160a01b031663095ea7b384866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156114bc57600080fd5b505af11580156114d0573d6000803e3d6000fd5b50505050816001600160a01b0316630e752702856040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561151a57600080fd5b505af115801561152e573d6000803e3d6000fd5b505050506040513d602081101561154457600080fd5b505115611588576040805162461bcd60e51b815260206004820152600d60248201526c3932b830bc96b330b4b632b21760991b604482015290519081900360640190fd5b505b6115948484612775565b604080516001600160a01b03848116825260208201869052818301889052606082018790529151918916917f9410947f31b0a8fec2af0832d79c52a241738266186f3bced73169fa08de95559181900360800190a2604080516001600160a01b03808a166020830152841681830152606081018590526080810187905260a08082018790528251808303909101815260c09091019091527f9410947f31b0a8fec2af0832d79c52a241738266186f3bced73169fa08de95559060008061062c6126c6565b600061166483856126ce565b9050600061167061275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156116bc57600080fd5b505afa1580156116d0573d6000803e3d6000fd5b505050506040513d60208110156116e657600080fd5b505190506116f381612805565b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561173e57600080fd5b505afa158015611752573d6000803e3d6000fd5b505050506040513d602081101561176857600080fd5b50519050611774612b0d565b6001600160a01b0316886001600160a01b031614156117f957600019841461179c578361179e565b475b9350826001600160a01b0316631249c58b856040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b50505050506119ac565b876000198514611809578461187c565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d602081101561187957600080fd5b50515b9450806001600160a01b031663095ea7b385876040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156118d557600080fd5b505af11580156118e9573d6000803e3d6000fd5b50505050826001600160a01b031663a0712d68866040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561193357600080fd5b505af1158015611947573d6000803e3d6000fd5b505050506040513d602081101561195d57600080fd5b5051156119aa576040805162461bcd60e51b81526020600482015260166024820152753232b837b9b4ba16b1ba37b5b2b716b330b4b632b21760511b604482015290519081900360640190fd5b505b6000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156119fb57600080fd5b505afa158015611a0f573d6000803e3d6000fd5b505050506040513d6020811015611a2557600080fd5b50519050818103611a368782612775565b604080516001600160a01b03878116825260208201899052818301849052606082018b9052608082018a90529151918c16917fdc898b62691a13e6247d463faaf8f7786968ca009de483714bb8d05ea8dd969b9181900360a00190a2604080516001600160a01b03808d166020830152871681830152606081018890526080810183905260a081018a905260c08082018a90528251808303909101815260e09091019091527fdc898b62691a13e6247d463faaf8f7786968ca009de483714bb8d05ea8dd969b90600080611b086126c6565b91509150611b146127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b84578181015183820152602001611b6c565b50505050905090810190601f168015611bb15780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611bd357600080fd5b505af1158015611be7573d6000803e3d6000fd5b505050505050505050505050505050505050565b6000611c0783856126ce565b90506000611c1361275d565b6001600160a01b031663104b29e9886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611c5f57600080fd5b505afa158015611c73573d6000803e3d6000fd5b505050506040513d6020811015611c8957600080fd5b505190506000611c9761275d565b6001600160a01b031663104b29e9886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611ce357600080fd5b505afa158015611cf7573d6000803e3d6000fd5b505050506040513d6020811015611d0d57600080fd5b50519050816000611d1c612b3d565b6001600160a01b0316635ec88c798c6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060606040518083038186803b158015611d6857600080fd5b505afa158015611d7c573d6000803e3d6000fd5b505050506040513d6060811015611d9257600080fd5b5060400151905080611deb576040805162461bcd60e51b815260206004820152601c60248201527f6163636f756e742d63616e6e6f742d62652d6c69717569646174656400000000604482015290519081900360640190fd5b6000198514611dfa5784611e76565b816001600160a01b03166317bfdfbc8c6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015611e4957600080fd5b505af1158015611e5d573d6000803e3d6000fd5b505050506040513d6020811015611e7357600080fd5b50515b9450611e80612b0d565b6001600160a01b03168a6001600160a01b03161415611f5e5784471015611ee0576040805162461bcd60e51b815260206004820152600f60248201526e0dcdee85acadcdeeaced0e85acae8d608b1b604482015290519081900360640190fd5b836001600160a01b031663aae40a2a868d866040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b03168152602001925050506000604051808303818588803b158015611f4057600080fd5b505af1158015611f54573d6000803e3d6000fd5b5050505050612164565b604080516370a0823160e01b815230600482015290518b9187916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015611fa857600080fd5b505afa158015611fbc573d6000803e3d6000fd5b505050506040513d6020811015611fd257600080fd5b5051101561201a576040805162461bcd60e51b815260206004820152601060248201526f3737ba16b2b737bab3b416ba37b5b2b760811b604482015290519081900360640190fd5b806001600160a01b031663095ea7b386886040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561207157600080fd5b505af1158015612085573d6000803e3d6000fd5b50505050826001600160a01b031663f5e3c4628d88876040518463ffffffff1660e01b815260040180846001600160a01b03168152602001838152602001826001600160a01b031681526020019350505050602060405180830381600087803b1580156120f157600080fd5b505af1158015612105573d6000803e3d6000fd5b505050506040513d602081101561211b57600080fd5b505115612162576040805162461bcd60e51b815260206004820152601060248201526f1b1a5c5d5a59185d194b59985a5b195960821b604482015290519081900360640190fd5b505b61216e8686612775565b604080518681526020810189905280820188905290516001600160a01b03808c1692908d169130917fa9455416d68b5a391e9d752873b8abc2667a996ce2b751cac634d7f36939f735919081900360600190a4604080513060208201526001600160a01b03808d16828401528b1660608201526080810187905260a0810189905260c08082018990528251808303909101815260e09091019091527fa9455416d68b5a391e9d752873b8abc2667a996ce2b751cac634d7f36939f735906000806122366126c6565b915091506122426127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156122b257818101518382015260200161229a565b50505050905090810190601f1680156122df5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561230157600080fd5b505af1158015612315573d6000803e3d6000fd5b50505050505050505050505050505050505050565b600061233683856126ce565b9050600061234261275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561238e57600080fd5b505afa1580156123a2573d6000803e3d6000fd5b505050506040513d60208110156123b857600080fd5b505190506123c581612805565b6123cd612b0d565b6001600160a01b0316866001600160a01b031614156124525760001982146123f557816123f7565b475b9150806001600160a01b0316631249c58b836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b50505050506125fc565b85600019831461246257826124d5565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b1580156124a857600080fd5b505afa1580156124bc573d6000803e3d6000fd5b505050506040513d60208110156124d257600080fd5b50515b9250806001600160a01b031663095ea7b383856040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561252e57600080fd5b505af1158015612542573d6000803e3d6000fd5b50505050816001600160a01b031663a0712d68846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561258c57600080fd5b505af11580156125a0573d6000803e3d6000fd5b505050506040513d60208110156125b657600080fd5b5051156125fa576040805162461bcd60e51b815260206004820152600d60248201526c189bdc9c9bddcb59985a5b1959609a1b604482015290519081900360640190fd5b505b6126068383612775565b604080516001600160a01b03838116825260208201859052818301879052606082018690529151918816917fab14747d46633612ff5c029a3117f98ffb6506ebf31bab40972f911b7dd188919181900360800190a2604080516001600160a01b038089166020830152831681830152606081018490526080810186905260a08082018690528251808303909101815260c09091019091527fab14747d46633612ff5c029a3117f98ffb6506ebf31bab40972f911b7dd18891906000806109395b600190601890565b60008215612754576126de612bab565b6001600160a01b031663a9c70eaa846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561272357600080fd5b505af1158015612737573d6000803e3d6000fd5b505050506040513d602081101561274d57600080fd5b5051612756565b815b9392505050565b73e81f70cc7c0d46e12d70efc60607f16bbd617e8890565b81156127e957612783612bab565b6001600160a01b03166361e3c94483836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156127d057600080fd5b505af11580156127e4573d6000803e3d6000fd5b505050505b5050565b732af7ea6cb911035f3eb1ed895cb6692c39ecba9790565b600061280f612b3d565b90506060816001600160a01b031663abfceffc306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b15801561286057600080fd5b505afa158015612874573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561289d57600080fd5b81019080805160405193929190846401000000008211156128bd57600080fd5b9083019060208201858111156128d257600080fd5b82518660208202830111640100000000821117156128ef57600080fd5b82525081516020918201928201910280838360005b8381101561291c578181015183820152602001612904565b5050505090500160405250505090506000805b825181101561297257846001600160a01b031683828151811061294e57fe5b60200260200101516001600160a01b0316141561296a57600191505b60010161292f565b5080612b07576040805160018082528183019092526060916020808301908036833701905050905084816000815181106129a857fe5b6001600160a01b03928316602091820292909201810191909152604051631853304760e31b8152600481018281528451602483015284519388169363c29982389386938392604490910191858101910280838360005b83811015612a165781810151838201526020016129fe565b5050505090500192505050600060405180830381600087803b158015612a3b57600080fd5b505af1158015612a4f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015612a7857600080fd5b8101908080516040519392919084640100000000821115612a9857600080fd5b908301906020820185811115612aad57600080fd5b8251866020820283011164010000000082111715612aca57600080fd5b82525081516020918201928201910280838360005b83811015612af7578181015183820152602001612adf565b5050505090500160405250505050505b50505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b73c00e94cb662c3520282e6f5717214004a7f2688890565b733d9819210a31b4961b30ef54be2aed79b9c9cd3b90565b80820382811115612ba5576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b92915050565b738a5419cfc711b2343c17a6abf4b2bafabb06957f9056fea2646970667358221220ee406345c017b6e33489de444bdacadfa04b0666c1dac124f22503203f62713264736f6c634300060c0033", + "deployedBytecode": "0x6080604052600436106100915760003560e01c8063a33d406f11610059578063a33d406f146101e7578063b6528b791461021f578063c3233d6114610257578063ce88b4391461029f578063eb15f781146102d757610091565b806306fdde03146100965780632cee00f41461012057806338baa4c21461015a5780634532d77614610192578063943e45a7146101ca575b600080fd5b3480156100a257600080fd5b506100ab610305565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100e55781810151838201526020016100cd565b50505050905090810190601f1680156101125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101586004803603608081101561013657600080fd5b506001600160a01b038135169060208101359060408101359060600135610393565b005b6101586004803603608081101561017057600080fd5b506001600160a01b03813516906020810135906040810135906060013561071c565b610158600480360360808110156101a857600080fd5b506001600160a01b038135169060208101359060408101359060600135610a28565b610158600480360360208110156101e057600080fd5b5035610ecc565b610158600480360360808110156101fd57600080fd5b506001600160a01b0381351690602081013590604081013590606001356111d0565b6101586004803603608081101561023557600080fd5b506001600160a01b038135169060208101359060408101359060600135611658565b610158600480360360c081101561026d57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060808101359060a00135611bfb565b610158600480360360808110156102b557600080fd5b506001600160a01b03813516906020810135906040810135906060013561232a565b3480156102e357600080fd5b506102ec6126c6565b6040805192835260208301919091528051918290030190f35b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561038b5780601f106103605761010080835404028352916020019161038b565b820191906000526020600020905b81548152906001019060200180831161036e57829003601f168201915b505050505081565b600061039f83856126ce565b905060006103ab61275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156103f757600080fd5b505afa15801561040b573d6000803e3d6000fd5b505050506040513d602081101561042157600080fd5b5051905080600019831461043557826104a8565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561047b57600080fd5b505afa15801561048f573d6000803e3d6000fd5b505050506040513d60208110156104a557600080fd5b50515b9250806001600160a01b031663db006a75846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156104f057600080fd5b505af1158015610504573d6000803e3d6000fd5b505050506040513d602081101561051a57600080fd5b50511561055e576040805162461bcd60e51b815260206004820152600d60248201526c1c995919595b4b59985a5b1959609a1b604482015290519081900360640190fd5b6105688484612775565b604080516001600160a01b03848116825260208201869052818301889052606082018790529151918916917f076dc1c4fe408b88a32238ee59e09b899084b3ee14bd7f9d0a287a335149070c9181900360800190a2604080516001600160a01b03808a166020830152841681830152606081018590526080810187905260a08082018790528251808303909101815260c09091019091527f076dc1c4fe408b88a32238ee59e09b899084b3ee14bd7f9d0a287a335149070c9060008061062c6126c6565b915091506106386127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156106a8578181015183820152602001610690565b50505050905090810190601f1680156106d55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156106f757600080fd5b505af115801561070b573d6000803e3d6000fd5b505050505050505050505050505050565b600061072883856126ce565b9050600061073461275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561078057600080fd5b505afa158015610794573d6000803e3d6000fd5b505050506040513d60208110156107aa57600080fd5b505190506107b781612805565b806001600160a01b031663c5ebeaec836040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156107fd57600080fd5b505af1158015610811573d6000803e3d6000fd5b505050506040513d602081101561082757600080fd5b50511561086b576040805162461bcd60e51b815260206004820152600d60248201526c189bdc9c9bddcb59985a5b1959609a1b604482015290519081900360640190fd5b6108758383612775565b604080516001600160a01b03838116825260208201859052818301879052606082018690529151918816917f3a5151e57d3bc9798e7853034ac52293d1a0e12a2b44725e75b03b21f86477a69181900360800190a2604080516001600160a01b038089166020830152831681830152606081018490526080810186905260a08082018690528251808303909101815260c09091019091527f3a5151e57d3bc9798e7853034ac52293d1a0e12a2b44725e75b03b21f86477a6906000806109396126c6565b915091506109456127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109b557818101518382015260200161099d565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a0457600080fd5b505af1158015610a18573d6000803e3d6000fd5b5050505050505050505050505050565b6000610a3483856126ce565b90506000610a4061275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d6020811015610ab657600080fd5b5051905080600019831415610d4857866000610ad0612b0d565b6001600160a01b0316896001600160a01b031614610b5f57604080516370a0823160e01b815230600482015290516001600160a01b038416916370a08231916024808301926020929190829003018186803b158015610b2e57600080fd5b505afa158015610b42573d6000803e3d6000fd5b505050506040513d6020811015610b5857600080fd5b5051610b61565b475b9050826001600160a01b031663db006a75846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610bbf57600080fd5b505afa158015610bd3573d6000803e3d6000fd5b505050506040513d6020811015610be957600080fd5b5051604080516001600160e01b031960e085901b16815260048101929092525160248083019260209291908290030181600087803b158015610c2a57600080fd5b505af1158015610c3e573d6000803e3d6000fd5b505050506040513d6020811015610c5457600080fd5b505115610c9f576040805162461bcd60e51b8152602060048201526014602482015273199d5b1b0b5dda5d1a191c985dcb59985a5b195960621b604482015290519081900360640190fd5b6000610ca9612b0d565b6001600160a01b03168a6001600160a01b031614610d3857604080516370a0823160e01b815230600482015290516001600160a01b038516916370a08231916024808301926020929190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b5051610d3a565b475b919091039450610dfe915050565b806001600160a01b031663852a12e3846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015610d8e57600080fd5b505af1158015610da2573d6000803e3d6000fd5b505050506040513d6020811015610db857600080fd5b505115610dfe576040805162461bcd60e51b815260206004820152600f60248201526e1dda5d1a191c985dcb59985a5b1959608a1b604482015290519081900360640190fd5b610e088484612775565b604080516001600160a01b03848116825260208201869052818301889052606082018790529151918916917facb207402cd2b663d2290a64caab15469bccde82d9c05051581c19189ea246959181900360800190a2604080516001600160a01b03808a166020830152841681830152606081018590526080810187905260a08082018790528251808303909101815260c09091019091527facb207402cd2b663d2290a64caab15469bccde82d9c05051581c19189ea246959060008061062c6126c6565b6000610ed6612b25565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610f2757600080fd5b505afa158015610f3b573d6000803e3d6000fd5b505050506040513d6020811015610f5157600080fd5b50519050610f5d612b3d565b6001600160a01b031663e9af0292306040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610fab57600080fd5b505af1158015610fbf573d6000803e3d6000fd5b505050506000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561101257600080fd5b505afa158015611026573d6000803e3d6000fd5b505050506040513d602081101561103c57600080fd5b50519050600061104c8284612b55565b90506110588582612775565b604080518281526020810187905281517f8f9643cd31938c964bb13e492f388a389da3dd8ac15a32c643356f50454f0114929181900390910190a1604080516020810183905280820187905281518082038301815260609091019091527f8f9643cd31938c964bb13e492f388a389da3dd8ac15a32c643356f50454f0114906000806110e26126c6565b915091506110ee6127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561115e578181015183820152602001611146565b50505050905090810190601f16801561118b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156111ad57600080fd5b505af11580156111c1573d6000803e3d6000fd5b50505050505050505050505050565b60006111dc83856126ce565b905060006111e861275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561123457600080fd5b505afa158015611248573d6000803e3d6000fd5b505050506040513d602081101561125e57600080fd5b5051905080600019831461127257826112e7565b604080516305eff7ef60e21b815230600482015290516001600160a01b038316916317bfdfbc9160248083019260209291908290030181600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506040513d60208110156112e457600080fd5b50515b92506112f1612b0d565b6001600160a01b0316876001600160a01b031614156113a95782471015611350576040805162461bcd60e51b815260206004820152600e60248201526d0dcdee85acadcdeeaced05acae8d60931b604482015290519081900360640190fd5b816001600160a01b0316634e4d9fea846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561138b57600080fd5b505af115801561139f573d6000803e3d6000fd5b505050505061158a565b604080516370a0823160e01b81523060048201529051889185916001600160a01b038416916370a08231916024808301926020929190829003018186803b1580156113f357600080fd5b505afa158015611407573d6000803e3d6000fd5b505050506040513d602081101561141d57600080fd5b50511015611465576040805162461bcd60e51b815260206004820152601060248201526f3737ba16b2b737bab3b416ba37b5b2b760811b604482015290519081900360640190fd5b806001600160a01b031663095ea7b384866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156114bc57600080fd5b505af11580156114d0573d6000803e3d6000fd5b50505050816001600160a01b0316630e752702856040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561151a57600080fd5b505af115801561152e573d6000803e3d6000fd5b505050506040513d602081101561154457600080fd5b505115611588576040805162461bcd60e51b815260206004820152600d60248201526c3932b830bc96b330b4b632b21760991b604482015290519081900360640190fd5b505b6115948484612775565b604080516001600160a01b03848116825260208201869052818301889052606082018790529151918916917f9410947f31b0a8fec2af0832d79c52a241738266186f3bced73169fa08de95559181900360800190a2604080516001600160a01b03808a166020830152841681830152606081018590526080810187905260a08082018790528251808303909101815260c09091019091527f9410947f31b0a8fec2af0832d79c52a241738266186f3bced73169fa08de95559060008061062c6126c6565b600061166483856126ce565b9050600061167061275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156116bc57600080fd5b505afa1580156116d0573d6000803e3d6000fd5b505050506040513d60208110156116e657600080fd5b505190506116f381612805565b604080516370a0823160e01b8152306004820152905182916000916001600160a01b038416916370a08231916024808301926020929190829003018186803b15801561173e57600080fd5b505afa158015611752573d6000803e3d6000fd5b505050506040513d602081101561176857600080fd5b50519050611774612b0d565b6001600160a01b0316886001600160a01b031614156117f957600019841461179c578361179e565b475b9350826001600160a01b0316631249c58b856040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b50505050506119ac565b876000198514611809578461187c565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561184f57600080fd5b505afa158015611863573d6000803e3d6000fd5b505050506040513d602081101561187957600080fd5b50515b9450806001600160a01b031663095ea7b385876040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156118d557600080fd5b505af11580156118e9573d6000803e3d6000fd5b50505050826001600160a01b031663a0712d68866040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561193357600080fd5b505af1158015611947573d6000803e3d6000fd5b505050506040513d602081101561195d57600080fd5b5051156119aa576040805162461bcd60e51b81526020600482015260166024820152753232b837b9b4ba16b1ba37b5b2b716b330b4b632b21760511b604482015290519081900360640190fd5b505b6000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156119fb57600080fd5b505afa158015611a0f573d6000803e3d6000fd5b505050506040513d6020811015611a2557600080fd5b50519050818103611a368782612775565b604080516001600160a01b03878116825260208201899052818301849052606082018b9052608082018a90529151918c16917fdc898b62691a13e6247d463faaf8f7786968ca009de483714bb8d05ea8dd969b9181900360a00190a2604080516001600160a01b03808d166020830152871681830152606081018890526080810183905260a081018a905260c08082018a90528251808303909101815260e09091019091527fdc898b62691a13e6247d463faaf8f7786968ca009de483714bb8d05ea8dd969b90600080611b086126c6565b91509150611b146127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b84578181015183820152602001611b6c565b50505050905090810190601f168015611bb15780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611bd357600080fd5b505af1158015611be7573d6000803e3d6000fd5b505050505050505050505050505050505050565b6000611c0783856126ce565b90506000611c1361275d565b6001600160a01b031663104b29e9886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611c5f57600080fd5b505afa158015611c73573d6000803e3d6000fd5b505050506040513d6020811015611c8957600080fd5b505190506000611c9761275d565b6001600160a01b031663104b29e9886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611ce357600080fd5b505afa158015611cf7573d6000803e3d6000fd5b505050506040513d6020811015611d0d57600080fd5b50519050816000611d1c612b3d565b6001600160a01b0316635ec88c798c6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060606040518083038186803b158015611d6857600080fd5b505afa158015611d7c573d6000803e3d6000fd5b505050506040513d6060811015611d9257600080fd5b5060400151905080611deb576040805162461bcd60e51b815260206004820152601c60248201527f6163636f756e742d63616e6e6f742d62652d6c69717569646174656400000000604482015290519081900360640190fd5b6000198514611dfa5784611e76565b816001600160a01b03166317bfdfbc8c6040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015611e4957600080fd5b505af1158015611e5d573d6000803e3d6000fd5b505050506040513d6020811015611e7357600080fd5b50515b9450611e80612b0d565b6001600160a01b03168a6001600160a01b03161415611f5e5784471015611ee0576040805162461bcd60e51b815260206004820152600f60248201526e0dcdee85acadcdeeaced0e85acae8d608b1b604482015290519081900360640190fd5b836001600160a01b031663aae40a2a868d866040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b03168152602001925050506000604051808303818588803b158015611f4057600080fd5b505af1158015611f54573d6000803e3d6000fd5b5050505050612164565b604080516370a0823160e01b815230600482015290518b9187916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015611fa857600080fd5b505afa158015611fbc573d6000803e3d6000fd5b505050506040513d6020811015611fd257600080fd5b5051101561201a576040805162461bcd60e51b815260206004820152601060248201526f3737ba16b2b737bab3b416ba37b5b2b760811b604482015290519081900360640190fd5b806001600160a01b031663095ea7b386886040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561207157600080fd5b505af1158015612085573d6000803e3d6000fd5b50505050826001600160a01b031663f5e3c4628d88876040518463ffffffff1660e01b815260040180846001600160a01b03168152602001838152602001826001600160a01b031681526020019350505050602060405180830381600087803b1580156120f157600080fd5b505af1158015612105573d6000803e3d6000fd5b505050506040513d602081101561211b57600080fd5b505115612162576040805162461bcd60e51b815260206004820152601060248201526f1b1a5c5d5a59185d194b59985a5b195960821b604482015290519081900360640190fd5b505b61216e8686612775565b604080518681526020810189905280820188905290516001600160a01b03808c1692908d169130917fa9455416d68b5a391e9d752873b8abc2667a996ce2b751cac634d7f36939f735919081900360600190a4604080513060208201526001600160a01b03808d16828401528b1660608201526080810187905260a0810189905260c08082018990528251808303909101815260e09091019091527fa9455416d68b5a391e9d752873b8abc2667a996ce2b751cac634d7f36939f735906000806122366126c6565b915091506122426127ed565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156122b257818101518382015260200161229a565b50505050905090810190601f1680156122df5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561230157600080fd5b505af1158015612315573d6000803e3d6000fd5b50505050505050505050505050505050505050565b600061233683856126ce565b9050600061234261275d565b6001600160a01b031663104b29e9876040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561238e57600080fd5b505afa1580156123a2573d6000803e3d6000fd5b505050506040513d60208110156123b857600080fd5b505190506123c581612805565b6123cd612b0d565b6001600160a01b0316866001600160a01b031614156124525760001982146123f557816123f7565b475b9150806001600160a01b0316631249c58b836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b50505050506125fc565b85600019831461246257826124d5565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b1580156124a857600080fd5b505afa1580156124bc573d6000803e3d6000fd5b505050506040513d60208110156124d257600080fd5b50515b9250806001600160a01b031663095ea7b383856040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561252e57600080fd5b505af1158015612542573d6000803e3d6000fd5b50505050816001600160a01b031663a0712d68846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561258c57600080fd5b505af11580156125a0573d6000803e3d6000fd5b505050506040513d60208110156125b657600080fd5b5051156125fa576040805162461bcd60e51b815260206004820152600d60248201526c189bdc9c9bddcb59985a5b1959609a1b604482015290519081900360640190fd5b505b6126068383612775565b604080516001600160a01b03838116825260208201859052818301879052606082018690529151918816917fab14747d46633612ff5c029a3117f98ffb6506ebf31bab40972f911b7dd188919181900360800190a2604080516001600160a01b038089166020830152831681830152606081018490526080810186905260a08082018690528251808303909101815260c09091019091527fab14747d46633612ff5c029a3117f98ffb6506ebf31bab40972f911b7dd18891906000806109395b600190601890565b60008215612754576126de612bab565b6001600160a01b031663a9c70eaa846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b15801561272357600080fd5b505af1158015612737573d6000803e3d6000fd5b505050506040513d602081101561274d57600080fd5b5051612756565b815b9392505050565b73e81f70cc7c0d46e12d70efc60607f16bbd617e8890565b81156127e957612783612bab565b6001600160a01b03166361e3c94483836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b1580156127d057600080fd5b505af11580156127e4573d6000803e3d6000fd5b505050505b5050565b732af7ea6cb911035f3eb1ed895cb6692c39ecba9790565b600061280f612b3d565b90506060816001600160a01b031663abfceffc306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060006040518083038186803b15801561286057600080fd5b505afa158015612874573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561289d57600080fd5b81019080805160405193929190846401000000008211156128bd57600080fd5b9083019060208201858111156128d257600080fd5b82518660208202830111640100000000821117156128ef57600080fd5b82525081516020918201928201910280838360005b8381101561291c578181015183820152602001612904565b5050505090500160405250505090506000805b825181101561297257846001600160a01b031683828151811061294e57fe5b60200260200101516001600160a01b0316141561296a57600191505b60010161292f565b5080612b07576040805160018082528183019092526060916020808301908036833701905050905084816000815181106129a857fe5b6001600160a01b03928316602091820292909201810191909152604051631853304760e31b8152600481018281528451602483015284519388169363c29982389386938392604490910191858101910280838360005b83811015612a165781810151838201526020016129fe565b5050505090500192505050600060405180830381600087803b158015612a3b57600080fd5b505af1158015612a4f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015612a7857600080fd5b8101908080516040519392919084640100000000821115612a9857600080fd5b908301906020820185811115612aad57600080fd5b8251866020820283011164010000000082111715612aca57600080fd5b82525081516020918201928201910280838360005b83811015612af7578181015183820152602001612adf565b5050505090500160405250505050505b50505050565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee90565b73c00e94cb662c3520282e6f5717214004a7f2688890565b733d9819210a31b4961b30ef54be2aed79b9c9cd3b90565b80820382811115612ba5576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b92915050565b738a5419cfc711b2343c17a6abf4b2bafabb06957f9056fea2646970667358221220ee406345c017b6e33489de444bdacadfa04b0666c1dac124f22503203f62713264736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/ConnectMaker.json b/pre-compiles/ConnectMaker.json new file mode 100644 index 0000000..e1ca447 --- /dev/null +++ b/pre-compiles/ConnectMaker.json @@ -0,0 +1,639 @@ +{ + "contractName": "ConnectMaker", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogBorrow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + } + ], + "name": "LogClose", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogDepositDai", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogExitDai", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + } + ], + "name": "LogOpen", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogPayback", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "LogTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogWithdrawDai", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "ilk", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenAmt", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "LogWithdrawLiquidated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "borrow", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + } + ], + "name": "close", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "connectorID", + "outputs": [ + { + "internalType": "uint256", + "name": "_type", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_id", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "depositDai", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "exitDai", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "colType", + "type": "string" + } + ], + "name": "open", + "outputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "payback", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "address", + "name": "nextOwner", + "type": "address" + } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "withdrawDai", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "vault", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "getId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "setId", + "type": "uint256" + } + ], + "name": "withdrawLiquidated", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50614269806100206000396000f3fe6080604052600436106100c25760003560e01c8063674fb1b41161007f578063d5e0da3611610059578063d5e0da36146102b0578063d6eac95d146102df578063e4dcb06b14610308578063eb15f7811461038a576100c2565b8063674fb1b414610226578063b7760c8f14610255578063c9fd076e14610281576100c2565b806306fdde03146100c75780630aebeb4e146101515780630faee32414610170578063111d94821461019f5780632505c3d9146101ce578063369fb4a9146101fd575b600080fd5b3480156100d357600080fd5b506100dc6103b8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61016e6004803603602081101561016757600080fd5b50356103e1565b005b61016e6004803603608081101561018657600080fd5b50803590602081013590604081013590606001356107ec565b61016e600480360360808110156101b557600080fd5b5080359060208101359060408101359060600135610ca3565b61016e600480360360808110156101e457600080fd5b508035906020810135906040810135906060013561104c565b61016e6004803603606081101561021357600080fd5b508035906020810135906040013561167f565b61016e6004803603608081101561023c57600080fd5b5080359060208101359060408101359060600135611cac565b61016e6004803603604081101561026b57600080fd5b50803590602001356001600160a01b031661237a565b61016e6004803603608081101561029757600080fd5b508035906020810135906040810135906060013561271f565b61016e600480360360808110156102c657600080fd5b5080359060208101359060408101359060600135612c0a565b61016e600480360360608110156102f557600080fd5b5080359060208101359060400135613015565b6103786004803603602081101561031e57600080fd5b81019060208101813564010000000081111561033957600080fd5b82018360208201111561034b57600080fd5b8035906020019184600183028401116401000000008311171561036d57600080fd5b5090925090506134e1565b60408051918252519081900360200190f35b34801561039657600080fd5b5061039f6137e2565b6040805192835260208301919091528051918290030190f35b6040518060400160405280600d81526020016c26b0b5b2b92230b796bb18971960991b81525081565b60006103eb6137ea565b905060006103f98284613802565b9050600080610408848461394a565b91509150600080856001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b505050506040513d602081101561047257600080fd5b5051604080516309092f9760e21b8152600481018790526001600160a01b0386811660248301528251931692632424be5c92604480840193919291829003018186803b1580156104c157600080fd5b505afa1580156104d5573d6000803e3d6000fd5b505050506040513d60408110156104eb57600080fd5b508051602090910151909250905081158015610505575080155b610549576040805162461bcd60e51b815260206004820152601060248201526f7661756c742d6861732d61737365747360801b604482015290519081900360640190fd5b306001600160a01b0316866001600160a01b0316638161b120876040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561059757600080fd5b505afa1580156105ab573d6000803e3d6000fd5b505050506040513d60208110156105c157600080fd5b50516001600160a01b03161461060a576040805162461bcd60e51b81526020600482015260096024820152683737ba16b7bbb732b960b91b604482015290519081900360640190fd5b856001600160a01b031663fcafcc6886610622613a3f565b6040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561066857600080fd5b505af115801561067c573d6000803e3d6000fd5b50506040518692508791507f2fd908dec911588d995135dbfe9257f33b2da24f12e8ddec0feabdfa3d372b8090600090a3604080516020810187905280820186905281518082038301815260609091019091527f2fd908dec911588d995135dbfe9257f33b2da24f12e8ddec0feabdfa3d372b80906000806106fc6137e2565b91509150610708613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610778578181015183820152602001610760565b50505050905090810190601f1680156107a55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156107c757600080fd5b505af11580156107db573d6000803e3d6000fd5b505050505050505050505050505050565b60006107f66137ea565b905060006108048486613a6f565b905060006108128388613802565b9050600080610821858461394a565b91509150600061082f613af8565b90506000866001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561086c57600080fd5b505afa158015610880573d6000803e3d6000fd5b505050506040513d602081101561089657600080fd5b5051905060001986141561092e57806001600160a01b0316636c25b346846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156108f157600080fd5b505afa158015610905573d6000803e3d6000fd5b505050506040513d602081101561091b57600080fd5b5051676765c793fa10079d601b1b900495505b866001600160a01b031663f9f30db686306109488a613b10565b6040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561099557600080fd5b505af11580156109a9573d6000803e3d6000fd5b505060408051634538c4eb60e01b81523060048201526001600160a01b03868116602483015291519185169350634538c4eb9250604480820192602092909190829003018186803b1580156109fd57600080fd5b505afa158015610a11573d6000803e3d6000fd5b505050506040513d6020811015610a2757600080fd5b5051610a9557806001600160a01b031663a3b22fc4836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b505050505b6040805163ef693bed60e01b81523060048201526024810188905290516001600160a01b0384169163ef693bed91604480830192600092919082900301818387803b158015610ae357600080fd5b505af1158015610af7573d6000803e3d6000fd5b50505050610b058887613b27565b60408051878152602081018b90528082018a90529051859187917f414ce0197969419d769a521b16b0f762067510271facc15e13db76f47a0388249181900360600190a3604080516020810187905280820186905260608101889052608081018b905260a08082018b90528251808303909101815260c09091019091527f414ce0197969419d769a521b16b0f762067510271facc15e13db76f47a03882490600080610baf6137e2565b91509150610bbb613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c2b578181015183820152602001610c13565b50505050905090810190601f168015610c585780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610c7a57600080fd5b505af1158015610c8e573d6000803e3d6000fd5b50505050505050505050505050505050505050565b6000610cad6137ea565b90506000610cbb8486613a6f565b90506000610cc98388613802565b9050600080610cd8858461394a565b915091506000610ce6613af8565b90506000866001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2357600080fd5b505afa158015610d37573d6000803e3d6000fd5b505050506040513d6020811015610d4d57600080fd5b505190506001600160a01b0387166345e6bdcd866000610d6f85888a8d613b9f565b6040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610db357600080fd5b505af1158015610dc7573d6000803e3d6000fd5b50505050866001600160a01b031663f9f30db68630610de58a613b10565b6040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610e3257600080fd5b505af1158015610e46573d6000803e3d6000fd5b505060408051634538c4eb60e01b81523060048201526001600160a01b03868116602483015291519185169350634538c4eb9250604480820192602092909190829003018186803b158015610e9a57600080fd5b505afa158015610eae573d6000803e3d6000fd5b505050506040513d6020811015610ec457600080fd5b5051610f3257806001600160a01b031663a3b22fc4836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b505050505b6040805163ef693bed60e01b81523060048201526024810188905290516001600160a01b0384169163ef693bed91604480830192600092919082900301818387803b158015610f8057600080fd5b505af1158015610f94573d6000803e3d6000fd5b50505050610fa28887613b27565b60408051878152602081018b90528082018a90529051859187917fcc4cc5923f656f98609fb750967fdc9c97da840b947b0767105dfe882f78fbe39181900360600190a3604080516020810187905280820186905260608101889052608081018b905260a08082018b90528251808303909101815260c09091019091527fcc4cc5923f656f98609fb750967fdc9c97da840b947b0767105dfe882f78fbe390600080610baf6137e2565b60006110566137ea565b905060006110648486613a6f565b905060006110728388613802565b9050600080611081858461394a565b91509150600061108f613d28565b6001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156110d257600080fd5b505afa1580156110e6573d6000803e3d6000fd5b505050506040513d60208110156110fc57600080fd5b505160408051637bd2bea760e01b8152905191925082916000916001600160a01b03841691637bd2bea79160048082019260209290919082900301818787803b15801561114857600080fd5b505af115801561115c573d6000803e3d6000fd5b505050506040513d602081101561117257600080fd5b5051905061117f81613d40565b156111f05760001987146111935786611195565b475b9650806001600160a01b031663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b5050505050611275565b60001987146111ff5786611272565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561124557600080fd5b505afa158015611259573d6000803e3d6000fd5b505050506040513d602081101561126f57600080fd5b50515b96505b806001600160a01b031663095ea7b384896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156112cc57600080fd5b505af11580156112e0573d6000803e3d6000fd5b505060408051633b4da69f60e01b8152306004820152602481018b905290516001600160a01b0386169350633b4da69f9250604480830192600092919082900301818387803b15801561133257600080fd5b505af1158015611346573d6000803e3d6000fd5b50505050876001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d60208110156113ad57600080fd5b81019080805190602001909291905050506001600160a01b0316637608870386863030611448611443896001600160a01b031663b3bcfa826040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b505050506040513d602081101561143b57600080fd5b50518f613d72565b613d84565b60006040518763ffffffff1660e01b815260040180878152602001866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b031681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156114be57600080fd5b505af11580156114d2573d6000803e3d6000fd5b505050506114e08988613b27565b60408051888152602081018c90528082018b90529051869188917ff6b11143bcb03d01b19ee0902b9a342de97f0763f16167ce082e17d147def5839181900360600190a3604080516020810188905280820187905260608101899052608081018c905260a08082018c90528251808303909101815260c09091019091527ff6b11143bcb03d01b19ee0902b9a342de97f0763f16167ce082e17d147def5839060008061158a6137e2565b91509150611596613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116065781810151838201526020016115ee565b50505050905090810190601f1680156116335780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561165557600080fd5b505af1158015611669573d6000803e3d6000fd5b5050505050505050505050505050505050505050565b600061168b8385613a6f565b90506000611697613dca565b905060006116a3613af8565b90508060001984146116b55783611791565b806001600160a01b031663f4b9fa756040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156116f057600080fd5b505af1158015611704573d6000803e3d6000fd5b505050506040513d602081101561171a57600080fd5b5051604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d602081101561178e57600080fd5b50515b93506000816001600160a01b03166336569e776040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b505050506040513d60208110156117fa57600080fd5b505160408051634fb3c66560e11b8152905191925085916000916001600160a01b03841691639f678cca9160048082019260209290919082900301818787803b15801561184657600080fd5b505af115801561185a573d6000803e3d6000fd5b505050506040513d602081101561187057600080fd5b50516040805163f4b9fa7560e01b815290519192506001600160a01b0386169163f4b9fa75916004808201926020929091908290030181600087803b1580156118b857600080fd5b505af11580156118cc573d6000803e3d6000fd5b505050506040513d60208110156118e257600080fd5b50516040805163095ea7b360e01b81526001600160a01b038881166004830152602482018b90529151919092169163095ea7b391604480830192600092919082900301818387803b15801561193657600080fd5b505af115801561194a573d6000803e3d6000fd5b505060408051633b4da69f60e01b8152306004820152602481018b905290516001600160a01b0388169350633b4da69f9250604480830192600092919082900301818387803b15801561199c57600080fd5b505af11580156119b0573d6000803e3d6000fd5b505060408051634538c4eb60e01b81523060048201526001600160a01b038a8116602483015291519187169350634538c4eb9250604480820192602092909190829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b5051611a9c57826001600160a01b031663a3b22fc4876040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611a8357600080fd5b505af1158015611a97573d6000803e3d6000fd5b505050505b816001600160a01b031663049878f382611ac18a676765c793fa10079d601b1b613de2565b81611ac857fe5b046040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611aff57600080fd5b505af1158015611b13573d6000803e3d6000fd5b50505050611b218888613b27565b60408051888152602081018b90528082018a905290517f7acdaada685d5f87171fe7b4bd4772c2f0e28ab13016b02abe309d5183ba8ecb9181900360600190a160408051602081018990528082018b905260608181018b90528251808303909101815260809091019091527f7acdaada685d5f87171fe7b4bd4772c2f0e28ab13016b02abe309d5183ba8ecb90600080611bb96137e2565b91509150611bc5613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611c35578181015183820152602001611c1d565b50505050905090810190601f168015611c625780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611c8457600080fd5b505af1158015611c98573d6000803e3d6000fd5b505050505050505050505050505050505050565b6000611cb66137ea565b90506000611cc48486613a6f565b90506000611cd28388613802565b9050600080611ce1858461394a565b915091506000611cef613d28565b6001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611d3257600080fd5b505afa158015611d46573d6000803e3d6000fd5b505050506040513d6020811015611d5c57600080fd5b50519050806000600019871415611ecd57876001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015611da657600080fd5b505afa158015611dba573d6000803e3d6000fd5b505050506040513d6020811015611dd057600080fd5b5051604080516309092f9760e21b8152600481018890526001600160a01b0387811660248301528251931692632424be5c92604480840193919291829003018186803b158015611e1f57600080fd5b505afa158015611e33573d6000803e3d6000fd5b505050506040513d6040811015611e4957600080fd5b5051604080516359de7d4160e11b81529051919250611ec6916001600160a01b0385169163b3bcfa829160048083019260209291908290030181600087803b158015611e9457600080fd5b505af1158015611ea8573d6000803e3d6000fd5b505050506040513d6020811015611ebe57600080fd5b505182613e3e565b9650611f40565b611f3d826001600160a01b031663b3bcfa826040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611f0b57600080fd5b505af1158015611f1f573d6000803e3d6000fd5b505050506040513d6020811015611f3557600080fd5b505188613d72565b90505b876001600160a01b03166345e6bdcd87611f5984613d84565b60000360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611fa257600080fd5b505af1158015611fb6573d6000803e3d6000fd5b5050604080516313771f0760e31b8152600481018a90523060248201526044810185905290516001600160a01b038c169350639bb8f8389250606480830192600092919082900301818387803b15801561200f57600080fd5b505af1158015612023573d6000803e3d6000fd5b505050506000826001600160a01b0316637bd2bea76040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561206457600080fd5b505af1158015612078573d6000803e3d6000fd5b505050506040513d602081101561208e57600080fd5b5051905061209b81613d40565b15612169576040805163ef693bed60e01b8152306004820152602481018a905290516001600160a01b0385169163ef693bed91604480830192600092919082900301818387803b1580156120ee57600080fd5b505af1158015612102573d6000803e3d6000fd5b50505050806001600160a01b0316632e1a7d4d896040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561214c57600080fd5b505af1158015612160573d6000803e3d6000fd5b505050506121d0565b6040805163ef693bed60e01b8152306004820152602481018a905290516001600160a01b0385169163ef693bed91604480830192600092919082900301818387803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050505b6121da8a89613b27565b60408051898152602081018d90528082018c90529051879189917f4a3b4684faa628d0d73d728df81132ef2643fe9d5a0fca7b40b63ba1cc3a137c9181900360600190a36040805160208101899052808201889052606081018a9052608081018d905260a08082018d90528251808303909101815260c09091019091527f4a3b4684faa628d0d73d728df81132ef2643fe9d5a0fca7b40b63ba1cc3a137c906000806122846137e2565b91509150612290613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156123005781810151838201526020016122e8565b50505050905090810190601f16801561232d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561234f57600080fd5b505af1158015612363573d6000803e3d6000fd5b505050505050505050505050505050505050505050565b60408051632520e7ff60e01b81526001600160a01b038316600482015290513091632520e7ff916024808301926020929190829003018186803b1580156123c057600080fd5b505afa1580156123d4573d6000803e3d6000fd5b505050506040513d60208110156123ea57600080fd5b5051612435576040805162461bcd60e51b81526020600482015260156024820152740dccaf0e89eeedccae45ad2e65adcdee85ac2eae8d605b1b604482015290519081900360640190fd5b600061243f6137ea565b9050600061244d8285613802565b9050600061245b838361394a565b509050306001600160a01b0316836001600160a01b0316638161b120846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156124ac57600080fd5b505afa1580156124c0573d6000803e3d6000fd5b505050506040513d60208110156124d657600080fd5b50516001600160a01b03161461251f576040805162461bcd60e51b81526020600482015260096024820152683737ba16b7bbb732b960b91b604482015290519081900360640190fd5b826001600160a01b031663fcafcc6883866040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561257657600080fd5b505af115801561258a573d6000803e3d6000fd5b5050604080516001600160a01b038816815290518493508592507f3dafb03636e0da80483e5469aecccf1113e303099d12839886ec104e0636ee549181900360200190a360408051602081018490528082018390526001600160a01b0386166060828101919091528251808303909101815260809091019091527f3dafb03636e0da80483e5469aecccf1113e303099d12839886ec104e0636ee54906000806126316137e2565b9150915061263d613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156126ad578181015183820152602001612695565b50505050905090810190601f1680156126da5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156126fc57600080fd5b505af1158015612710573d6000803e3d6000fd5b50505050505050505050505050565b60006127296137ea565b905060006127378486613a6f565b9050600080612746848961394a565b915091506000612754613d28565b6001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561279757600080fd5b505afa1580156127ab573d6000803e3d6000fd5b505050506040513d60208110156127c157600080fd5b5051905080600060001986141561293657866001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561280b57600080fd5b505afa15801561281f573d6000803e3d6000fd5b505050506040513d602081101561283557600080fd5b50516040805163214414d560e01b8152600481018890526001600160a01b0387811660248301529151919092169163214414d5916044808301926020929190829003018186803b15801561288857600080fd5b505afa15801561289c573d6000803e3d6000fd5b505050506040513d60208110156128b257600080fd5b5051604080516359de7d4160e11b8152905191925061292f916001600160a01b0385169163b3bcfa829160048083019260209291908290030181600087803b1580156128fd57600080fd5b505af1158015612911573d6000803e3d6000fd5b505050506040513d602081101561292757600080fd5b505187613e3e565b95506129a9565b6129a6826001600160a01b031663b3bcfa826040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561297457600080fd5b505af1158015612988573d6000803e3d6000fd5b505050506040513d602081101561299e57600080fd5b505187613d72565b90505b604080516313771f0760e31b8152600481018d90523060248201526044810183905290516001600160a01b03891691639bb8f83891606480830192600092919082900301818387803b1580156129fe57600080fd5b505af1158015612a12573d6000803e3d6000fd5b505050506000826001600160a01b0316637bd2bea76040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612a5357600080fd5b505af1158015612a67573d6000803e3d6000fd5b505050506040513d6020811015612a7d57600080fd5b50516040805163ef693bed60e01b8152306004820152602481018a905290519192506001600160a01b0385169163ef693bed9160448082019260009290919082900301818387803b158015612ad157600080fd5b505af1158015612ae5573d6000803e3d6000fd5b50505050612af281613d40565b15612b5657806001600160a01b0316632e1a7d4d886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612b3d57600080fd5b505af1158015612b51573d6000803e3d6000fd5b505050505b612b608988613b27565b60408051888152602081018c90528082018b9052905187918e917f7d1a1a10927b49642644fb6a1d7a28e9efdff50f4f56543cdd932bbe818dc20b9181900360600190a360408051602081018e905280820188905260608101899052608081018c905260a08082018c90528251808303909101815260c09091019091527f7d1a1a10927b49642644fb6a1d7a28e9efdff50f4f56543cdd932bbe818dc20b9060008061158a6137e2565b6000612c146137ea565b90506000612c228486613a6f565b90506000612c308388613802565b9050600080612c3f858461394a565b915091506000856001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015612c7e57600080fd5b505afa158015612c92573d6000803e3d6000fd5b505050506040513d6020811015612ca857600080fd5b505190506000612cb9828585613e57565b90506000198614612cca5785612ccc565b805b955085811015612d18576040805162461bcd60e51b81526020600482015260126024820152711c185e5a5b99cb595e18d95cdccb5919589d60721b604482015290519081900360640190fd5b6000612d22613af8565b9050806001600160a01b031663f4b9fa756040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612d5f57600080fd5b505af1158015612d73573d6000803e3d6000fd5b505050506040513d6020811015612d8957600080fd5b50516001600160a01b031663095ea7b3612da1613af8565b896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015612de857600080fd5b505af1158015612dfc573d6000803e3d6000fd5b50505050806001600160a01b0316633b4da69f85896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015612e5757600080fd5b505af1158015612e6b573d6000803e3d6000fd5b50505050876001600160a01b03166345e6bdcd876000612f0587886001600160a01b0316636c25b3468b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612ed257600080fd5b505afa158015612ee6573d6000803e3d6000fd5b505050506040513d6020811015612efc57600080fd5b50518a8c614024565b6040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015612f4957600080fd5b505af1158015612f5d573d6000803e3d6000fd5b50505050612f6b8988613b27565b60408051888152602081018c90528082018b90529051869188917fde62a5a99e6cbec0ce3c06281560c2e950f5e9749e8bcecb2e33d0918b5c42969181900360600190a3604080516020810188905280820187905260608101899052608081018c905260a08082018c90528251808303909101815260c09091019091527fde62a5a99e6cbec0ce3c06281560c2e950f5e9749e8bcecb2e33d0918b5c42969060008061158a6137e2565b600061301f613af8565b9050600061302d8486613a6f565b905060008290506000816001600160a01b03166336569e776040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561307157600080fd5b505af1158015613085573d6000803e3d6000fd5b505050506040513d602081101561309b57600080fd5b5051905060006130a9613dca565b90506000816001600160a01b0316639f678cca6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156130e857600080fd5b505af11580156130fc573d6000803e3d6000fd5b505050506040513d602081101561311257600080fd5b5051905060006000198614156131bb57604080516305f5d64360e11b815230600482015290516001600160a01b03851691630bebac86916024808301926020929190829003018186803b15801561316857600080fd5b505afa15801561317c573d6000803e3d6000fd5b505050506040513d602081101561319257600080fd5b50519050676765c793fa10079d601b1b6131ac8383613de2565b816131b357fe5b0495506131dc565b816131d187676765c793fa10079d601b1b613de2565b816131d857fe5b0490505b826001600160a01b0316637f8661a1826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561322257600080fd5b505af1158015613236573d6000803e3d6000fd5b505050506000846001600160a01b0316636c25b346306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561328957600080fd5b505afa15801561329d573d6000803e3d6000fd5b505050506040513d60208110156132b357600080fd5b505160408051634538c4eb60e01b81523060048201526001600160a01b038b81166024830152915192935090871691634538c4eb91604480820192602092909190829003018186803b15801561330857600080fd5b505afa15801561331c573d6000803e3d6000fd5b505050506040513d602081101561333257600080fd5b50516133a057846001600160a01b031663a3b22fc4896040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561338757600080fd5b505af115801561339b573d6000803e3d6000fd5b505050505b856001600160a01b031663ef693bed306133c58a676765c793fa10079d601b1b613de2565b8410156133df57676765c793fa10079d601b1b84046133e1565b895b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561342757600080fd5b505af115801561343b573d6000803e3d6000fd5b505050506134498988613b27565b60408051888152602081018c90528082018b905290517f777e0947419ce926e4c968b17ebe2ab9300a139fe6d2dc884d736a0d9092e4a89181900360600190a160408051602081018990528082018c905260608181018c90528251808303909101815260809091019091527f777e0947419ce926e4c968b17ebe2ab9300a139fe6d2dc884d736a0d9092e4a890600080610baf6137e2565b60008061352384848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061415492505050565b9050600061352f613d28565b6001600160a01b0316634445d799836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561357257600080fd5b505afa158015613586573d6000803e3d6000fd5b505050506040513d602081101561359c57600080fd5b50516001600160a01b031614156135eb576040805162461bcd60e51b815260206004820152600e60248201526d77726f6e672d636f6c2d7479706560901b604482015290519081900360640190fd5b6135f36137ea565b6001600160a01b0316636090dec582306040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050602060405180830381600087803b15801561364957600080fd5b505af115801561365d573d6000803e3d6000fd5b505050506040513d602081101561367357600080fd5b5051604051909250819083907f27d82e3f86469d4c4bf87f285ea64e3f40763a52f70b95c6b2f818caf264ef7890600090a3604080516020810184905280820183905281518082038301815260609091019091527f27d82e3f86469d4c4bf87f285ea64e3f40763a52f70b95c6b2f818caf264ef78906000806136f46137e2565b91509150613700613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613770578181015183820152602001613758565b50505050905090810190601f16801561379d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156137bf57600080fd5b505af11580156137d3573d6000803e3d6000fd5b50505050505050505092915050565b600190601a90565b735ef30b9986345249bc32d8928b7ee64de9435e3990565b600081613941576000836001600160a01b03166305d85eda306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561385857600080fd5b505afa15801561386c573d6000803e3d6000fd5b505050506040513d602081101561388257600080fd5b5051116138c8576040805162461bcd60e51b815260206004820152600f60248201526e1b9bcb5d985d5b1d0b5bdc195b9959608a1b604482015290519081900360640190fd5b60408051639a816f7d60e01b815230600482015290516001600160a01b03851691639a816f7d916024808301926020929190829003018186803b15801561390e57600080fd5b505afa158015613922573d6000803e3d6000fd5b505050506040513d602081101561393857600080fd5b50519050613944565b50805b92915050565b600080836001600160a01b0316632c2cb9fd846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561399157600080fd5b505afa1580156139a5573d6000803e3d6000fd5b505050506040513d60208110156139bb57600080fd5b505160408051632726b07360e01b81526004810186905290519193506001600160a01b03861691632726b07391602480820192602092909190829003018186803b158015613a0857600080fd5b505afa158015613a1c573d6000803e3d6000fd5b505050506040513d6020811015613a3257600080fd5b5051919491935090915050565b734dd58550eb15190a5b3dfae28bb14eec181fc26790565b732af7ea6cb911035f3eb1ed895cb6692c39ecba9790565b6000821561394157613a7f6141a4565b6001600160a01b031663a9c70eaa846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015613ac457600080fd5b505af1158015613ad8573d6000803e3d6000fd5b505050506040513d6020811015613aee57600080fd5b50515b9392505050565b739759a6ac90977b93b58547b4a71c78317f391a2890565b600061394482676765c793fa10079d601b1b613de2565b8115613b9b57613b356141a4565b6001600160a01b03166361e3c94483836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015613b8257600080fd5b505af1158015613b96573d6000803e3d6000fd5b505050505b5050565b600080613baa6141bc565b90506000816001600160a01b03166344e2a5a8866040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015613bf457600080fd5b505af1158015613c08573d6000803e3d6000fd5b505050506040513d6020811015613c1e57600080fd5b505160408051633612d9a360e11b81526001600160a01b0389811660048301529151929350600092918a1691636c25b34691602480820192602092909190829003018186803b158015613c7057600080fd5b505afa158015613c84573d6000803e3d6000fd5b505050506040513d6020811015613c9a57600080fd5b50519050613cb385676765c793fa10079d601b1b613de2565b811015613d1d57613ce982613cdc613cd688676765c793fa10079d601b1b613de2565b846141d4565b81613ce357fe5b04613d84565b9350613d0085676765c793fa10079d601b1b613de2565b613d0a8584613de2565b10613d155783613d1a565b836001015b93505b505050949350505050565b73e81f70cc7c0d46e12d70efc60607f16bbd617e8890565b6000613d4a61421b565b6001600160a01b0316826001600160a01b031614613d69576000613944565b5060015b919050565b6000613af18284601203600a0a613de2565b806000811215613d6d576040805162461bcd60e51b815260206004820152600c60248201526b696e742d6f766572666c6f7760a01b604482015290519081900360640190fd5b73197e90f9fad81970ba7976f33cbd77088e5d7cf790565b6000811580613dfd57505080820282828281613dfa57fe5b04145b613944576040805162461bcd60e51b815260206004820152600d60248201526c6d6174682d6e6f742d7361666560981b604482015290519081900360640190fd5b600082601203600a0a8281613e4f57fe5b049392505050565b600080846001600160a01b031663d9638d36856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b158015613e9e57600080fd5b505afa158015613eb2573d6000803e3d6000fd5b505050506040513d60a0811015613ec857600080fd5b5060200151604080516309092f9760e21b8152600481018790526001600160a01b038681166024830152825193945060009390891692632424be5c9260448082019391829003018186803b158015613f1f57600080fd5b505afa158015613f33573d6000803e3d6000fd5b505050506040513d6040811015613f4957600080fd5b5060209081015160408051633612d9a360e11b81526001600160a01b0388811660048301529151929450600093918a1692636c25b34692602480840193919291829003018186803b158015613f9d57600080fd5b505afa158015613fb1573d6000803e3d6000fd5b505050506040513d6020811015613fc757600080fd5b505190506000613fe0613fda8486613de2565b836141d4565b9050676765c793fa10079d601b1b810494508061400886676765c793fa10079d601b1b613de2565b106140135784614018565b846001015b98975050505050505050565b600080856001600160a01b031663d9638d36846040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b15801561406b57600080fd5b505afa15801561407f573d6000803e3d6000fd5b505050506040513d60a081101561409557600080fd5b5060200151604080516309092f9760e21b8152600481018690526001600160a01b0387811660248301528251939450600093908a1692632424be5c9260448082019391829003018186803b1580156140ec57600080fd5b505afa158015614100573d6000803e3d6000fd5b505050506040513d604081101561411657600080fd5b50602001519050614129828781613ce357fe5b9250808311156141445761413c81613d84565b600003614149565b826000035b979650505050505050565b600081516000141561419c576040805162461bcd60e51b815260206004820152600c60248201526b737472696e672d656d70747960a01b604482015290519081900360640190fd5b506020015190565b738a5419cfc711b2343c17a6abf4b2bafabb06957f90565b7319c0976f590d67707e62397c87829d896dc0f1f190565b80820382811115613944576040805162461bcd60e51b815260206004820152600c60248201526b7375622d6f766572666c6f7760a01b604482015290519081900360640190fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29056fea2646970667358221220a08939b10c28b00ad60dcf3da607bd5a8dcadc1d3efa2c042d1a3933080b44dd64736f6c634300060c0033", + "deployedBytecode": "0x6080604052600436106100c25760003560e01c8063674fb1b41161007f578063d5e0da3611610059578063d5e0da36146102b0578063d6eac95d146102df578063e4dcb06b14610308578063eb15f7811461038a576100c2565b8063674fb1b414610226578063b7760c8f14610255578063c9fd076e14610281576100c2565b806306fdde03146100c75780630aebeb4e146101515780630faee32414610170578063111d94821461019f5780632505c3d9146101ce578063369fb4a9146101fd575b600080fd5b3480156100d357600080fd5b506100dc6103b8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61016e6004803603602081101561016757600080fd5b50356103e1565b005b61016e6004803603608081101561018657600080fd5b50803590602081013590604081013590606001356107ec565b61016e600480360360808110156101b557600080fd5b5080359060208101359060408101359060600135610ca3565b61016e600480360360808110156101e457600080fd5b508035906020810135906040810135906060013561104c565b61016e6004803603606081101561021357600080fd5b508035906020810135906040013561167f565b61016e6004803603608081101561023c57600080fd5b5080359060208101359060408101359060600135611cac565b61016e6004803603604081101561026b57600080fd5b50803590602001356001600160a01b031661237a565b61016e6004803603608081101561029757600080fd5b508035906020810135906040810135906060013561271f565b61016e600480360360808110156102c657600080fd5b5080359060208101359060408101359060600135612c0a565b61016e600480360360608110156102f557600080fd5b5080359060208101359060400135613015565b6103786004803603602081101561031e57600080fd5b81019060208101813564010000000081111561033957600080fd5b82018360208201111561034b57600080fd5b8035906020019184600183028401116401000000008311171561036d57600080fd5b5090925090506134e1565b60408051918252519081900360200190f35b34801561039657600080fd5b5061039f6137e2565b6040805192835260208301919091528051918290030190f35b6040518060400160405280600d81526020016c26b0b5b2b92230b796bb18971960991b81525081565b60006103eb6137ea565b905060006103f98284613802565b9050600080610408848461394a565b91509150600080856001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b505050506040513d602081101561047257600080fd5b5051604080516309092f9760e21b8152600481018790526001600160a01b0386811660248301528251931692632424be5c92604480840193919291829003018186803b1580156104c157600080fd5b505afa1580156104d5573d6000803e3d6000fd5b505050506040513d60408110156104eb57600080fd5b508051602090910151909250905081158015610505575080155b610549576040805162461bcd60e51b815260206004820152601060248201526f7661756c742d6861732d61737365747360801b604482015290519081900360640190fd5b306001600160a01b0316866001600160a01b0316638161b120876040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561059757600080fd5b505afa1580156105ab573d6000803e3d6000fd5b505050506040513d60208110156105c157600080fd5b50516001600160a01b03161461060a576040805162461bcd60e51b81526020600482015260096024820152683737ba16b7bbb732b960b91b604482015290519081900360640190fd5b856001600160a01b031663fcafcc6886610622613a3f565b6040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561066857600080fd5b505af115801561067c573d6000803e3d6000fd5b50506040518692508791507f2fd908dec911588d995135dbfe9257f33b2da24f12e8ddec0feabdfa3d372b8090600090a3604080516020810187905280820186905281518082038301815260609091019091527f2fd908dec911588d995135dbfe9257f33b2da24f12e8ddec0feabdfa3d372b80906000806106fc6137e2565b91509150610708613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610778578181015183820152602001610760565b50505050905090810190601f1680156107a55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156107c757600080fd5b505af11580156107db573d6000803e3d6000fd5b505050505050505050505050505050565b60006107f66137ea565b905060006108048486613a6f565b905060006108128388613802565b9050600080610821858461394a565b91509150600061082f613af8565b90506000866001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561086c57600080fd5b505afa158015610880573d6000803e3d6000fd5b505050506040513d602081101561089657600080fd5b5051905060001986141561092e57806001600160a01b0316636c25b346846040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156108f157600080fd5b505afa158015610905573d6000803e3d6000fd5b505050506040513d602081101561091b57600080fd5b5051676765c793fa10079d601b1b900495505b866001600160a01b031663f9f30db686306109488a613b10565b6040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b15801561099557600080fd5b505af11580156109a9573d6000803e3d6000fd5b505060408051634538c4eb60e01b81523060048201526001600160a01b03868116602483015291519185169350634538c4eb9250604480820192602092909190829003018186803b1580156109fd57600080fd5b505afa158015610a11573d6000803e3d6000fd5b505050506040513d6020811015610a2757600080fd5b5051610a9557806001600160a01b031663a3b22fc4836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b505050505b6040805163ef693bed60e01b81523060048201526024810188905290516001600160a01b0384169163ef693bed91604480830192600092919082900301818387803b158015610ae357600080fd5b505af1158015610af7573d6000803e3d6000fd5b50505050610b058887613b27565b60408051878152602081018b90528082018a90529051859187917f414ce0197969419d769a521b16b0f762067510271facc15e13db76f47a0388249181900360600190a3604080516020810187905280820186905260608101889052608081018b905260a08082018b90528251808303909101815260c09091019091527f414ce0197969419d769a521b16b0f762067510271facc15e13db76f47a03882490600080610baf6137e2565b91509150610bbb613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c2b578181015183820152602001610c13565b50505050905090810190601f168015610c585780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610c7a57600080fd5b505af1158015610c8e573d6000803e3d6000fd5b50505050505050505050505050505050505050565b6000610cad6137ea565b90506000610cbb8486613a6f565b90506000610cc98388613802565b9050600080610cd8858461394a565b915091506000610ce6613af8565b90506000866001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2357600080fd5b505afa158015610d37573d6000803e3d6000fd5b505050506040513d6020811015610d4d57600080fd5b505190506001600160a01b0387166345e6bdcd866000610d6f85888a8d613b9f565b6040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015610db357600080fd5b505af1158015610dc7573d6000803e3d6000fd5b50505050866001600160a01b031663f9f30db68630610de58a613b10565b6040518463ffffffff1660e01b815260040180848152602001836001600160a01b031681526020018281526020019350505050600060405180830381600087803b158015610e3257600080fd5b505af1158015610e46573d6000803e3d6000fd5b505060408051634538c4eb60e01b81523060048201526001600160a01b03868116602483015291519185169350634538c4eb9250604480820192602092909190829003018186803b158015610e9a57600080fd5b505afa158015610eae573d6000803e3d6000fd5b505050506040513d6020811015610ec457600080fd5b5051610f3257806001600160a01b031663a3b22fc4836040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b505050505b6040805163ef693bed60e01b81523060048201526024810188905290516001600160a01b0384169163ef693bed91604480830192600092919082900301818387803b158015610f8057600080fd5b505af1158015610f94573d6000803e3d6000fd5b50505050610fa28887613b27565b60408051878152602081018b90528082018a90529051859187917fcc4cc5923f656f98609fb750967fdc9c97da840b947b0767105dfe882f78fbe39181900360600190a3604080516020810187905280820186905260608101889052608081018b905260a08082018b90528251808303909101815260c09091019091527fcc4cc5923f656f98609fb750967fdc9c97da840b947b0767105dfe882f78fbe390600080610baf6137e2565b60006110566137ea565b905060006110648486613a6f565b905060006110728388613802565b9050600080611081858461394a565b91509150600061108f613d28565b6001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156110d257600080fd5b505afa1580156110e6573d6000803e3d6000fd5b505050506040513d60208110156110fc57600080fd5b505160408051637bd2bea760e01b8152905191925082916000916001600160a01b03841691637bd2bea79160048082019260209290919082900301818787803b15801561114857600080fd5b505af115801561115c573d6000803e3d6000fd5b505050506040513d602081101561117257600080fd5b5051905061117f81613d40565b156111f05760001987146111935786611195565b475b9650806001600160a01b031663d0e30db0886040518263ffffffff1660e01b81526004016000604051808303818588803b1580156111d257600080fd5b505af11580156111e6573d6000803e3d6000fd5b5050505050611275565b60001987146111ff5786611272565b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561124557600080fd5b505afa158015611259573d6000803e3d6000fd5b505050506040513d602081101561126f57600080fd5b50515b96505b806001600160a01b031663095ea7b384896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156112cc57600080fd5b505af11580156112e0573d6000803e3d6000fd5b505060408051633b4da69f60e01b8152306004820152602481018b905290516001600160a01b0386169350633b4da69f9250604480830192600092919082900301818387803b15801561133257600080fd5b505af1158015611346573d6000803e3d6000fd5b50505050876001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d60208110156113ad57600080fd5b81019080805190602001909291905050506001600160a01b0316637608870386863030611448611443896001600160a01b031663b3bcfa826040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b505050506040513d602081101561143b57600080fd5b50518f613d72565b613d84565b60006040518763ffffffff1660e01b815260040180878152602001866001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b031681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156114be57600080fd5b505af11580156114d2573d6000803e3d6000fd5b505050506114e08988613b27565b60408051888152602081018c90528082018b90529051869188917ff6b11143bcb03d01b19ee0902b9a342de97f0763f16167ce082e17d147def5839181900360600190a3604080516020810188905280820187905260608101899052608081018c905260a08082018c90528251808303909101815260c09091019091527ff6b11143bcb03d01b19ee0902b9a342de97f0763f16167ce082e17d147def5839060008061158a6137e2565b91509150611596613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116065781810151838201526020016115ee565b50505050905090810190601f1680156116335780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561165557600080fd5b505af1158015611669573d6000803e3d6000fd5b5050505050505050505050505050505050505050565b600061168b8385613a6f565b90506000611697613dca565b905060006116a3613af8565b90508060001984146116b55783611791565b806001600160a01b031663f4b9fa756040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156116f057600080fd5b505af1158015611704573d6000803e3d6000fd5b505050506040513d602081101561171a57600080fd5b5051604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d602081101561178e57600080fd5b50515b93506000816001600160a01b03166336569e776040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156117d057600080fd5b505af11580156117e4573d6000803e3d6000fd5b505050506040513d60208110156117fa57600080fd5b505160408051634fb3c66560e11b8152905191925085916000916001600160a01b03841691639f678cca9160048082019260209290919082900301818787803b15801561184657600080fd5b505af115801561185a573d6000803e3d6000fd5b505050506040513d602081101561187057600080fd5b50516040805163f4b9fa7560e01b815290519192506001600160a01b0386169163f4b9fa75916004808201926020929091908290030181600087803b1580156118b857600080fd5b505af11580156118cc573d6000803e3d6000fd5b505050506040513d60208110156118e257600080fd5b50516040805163095ea7b360e01b81526001600160a01b038881166004830152602482018b90529151919092169163095ea7b391604480830192600092919082900301818387803b15801561193657600080fd5b505af115801561194a573d6000803e3d6000fd5b505060408051633b4da69f60e01b8152306004820152602481018b905290516001600160a01b0388169350633b4da69f9250604480830192600092919082900301818387803b15801561199c57600080fd5b505af11580156119b0573d6000803e3d6000fd5b505060408051634538c4eb60e01b81523060048201526001600160a01b038a8116602483015291519187169350634538c4eb9250604480820192602092909190829003018186803b158015611a0457600080fd5b505afa158015611a18573d6000803e3d6000fd5b505050506040513d6020811015611a2e57600080fd5b5051611a9c57826001600160a01b031663a3b22fc4876040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b158015611a8357600080fd5b505af1158015611a97573d6000803e3d6000fd5b505050505b816001600160a01b031663049878f382611ac18a676765c793fa10079d601b1b613de2565b81611ac857fe5b046040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611aff57600080fd5b505af1158015611b13573d6000803e3d6000fd5b50505050611b218888613b27565b60408051888152602081018b90528082018a905290517f7acdaada685d5f87171fe7b4bd4772c2f0e28ab13016b02abe309d5183ba8ecb9181900360600190a160408051602081018990528082018b905260608181018b90528251808303909101815260809091019091527f7acdaada685d5f87171fe7b4bd4772c2f0e28ab13016b02abe309d5183ba8ecb90600080611bb96137e2565b91509150611bc5613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611c35578181015183820152602001611c1d565b50505050905090810190601f168015611c625780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611c8457600080fd5b505af1158015611c98573d6000803e3d6000fd5b505050505050505050505050505050505050565b6000611cb66137ea565b90506000611cc48486613a6f565b90506000611cd28388613802565b9050600080611ce1858461394a565b915091506000611cef613d28565b6001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015611d3257600080fd5b505afa158015611d46573d6000803e3d6000fd5b505050506040513d6020811015611d5c57600080fd5b50519050806000600019871415611ecd57876001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015611da657600080fd5b505afa158015611dba573d6000803e3d6000fd5b505050506040513d6020811015611dd057600080fd5b5051604080516309092f9760e21b8152600481018890526001600160a01b0387811660248301528251931692632424be5c92604480840193919291829003018186803b158015611e1f57600080fd5b505afa158015611e33573d6000803e3d6000fd5b505050506040513d6040811015611e4957600080fd5b5051604080516359de7d4160e11b81529051919250611ec6916001600160a01b0385169163b3bcfa829160048083019260209291908290030181600087803b158015611e9457600080fd5b505af1158015611ea8573d6000803e3d6000fd5b505050506040513d6020811015611ebe57600080fd5b505182613e3e565b9650611f40565b611f3d826001600160a01b031663b3bcfa826040518163ffffffff1660e01b8152600401602060405180830381600087803b158015611f0b57600080fd5b505af1158015611f1f573d6000803e3d6000fd5b505050506040513d6020811015611f3557600080fd5b505188613d72565b90505b876001600160a01b03166345e6bdcd87611f5984613d84565b60000360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015611fa257600080fd5b505af1158015611fb6573d6000803e3d6000fd5b5050604080516313771f0760e31b8152600481018a90523060248201526044810185905290516001600160a01b038c169350639bb8f8389250606480830192600092919082900301818387803b15801561200f57600080fd5b505af1158015612023573d6000803e3d6000fd5b505050506000826001600160a01b0316637bd2bea76040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561206457600080fd5b505af1158015612078573d6000803e3d6000fd5b505050506040513d602081101561208e57600080fd5b5051905061209b81613d40565b15612169576040805163ef693bed60e01b8152306004820152602481018a905290516001600160a01b0385169163ef693bed91604480830192600092919082900301818387803b1580156120ee57600080fd5b505af1158015612102573d6000803e3d6000fd5b50505050806001600160a01b0316632e1a7d4d896040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561214c57600080fd5b505af1158015612160573d6000803e3d6000fd5b505050506121d0565b6040805163ef693bed60e01b8152306004820152602481018a905290516001600160a01b0385169163ef693bed91604480830192600092919082900301818387803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050505b6121da8a89613b27565b60408051898152602081018d90528082018c90529051879189917f4a3b4684faa628d0d73d728df81132ef2643fe9d5a0fca7b40b63ba1cc3a137c9181900360600190a36040805160208101899052808201889052606081018a9052608081018d905260a08082018d90528251808303909101815260c09091019091527f4a3b4684faa628d0d73d728df81132ef2643fe9d5a0fca7b40b63ba1cc3a137c906000806122846137e2565b91509150612290613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156123005781810151838201526020016122e8565b50505050905090810190601f16801561232d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561234f57600080fd5b505af1158015612363573d6000803e3d6000fd5b505050505050505050505050505050505050505050565b60408051632520e7ff60e01b81526001600160a01b038316600482015290513091632520e7ff916024808301926020929190829003018186803b1580156123c057600080fd5b505afa1580156123d4573d6000803e3d6000fd5b505050506040513d60208110156123ea57600080fd5b5051612435576040805162461bcd60e51b81526020600482015260156024820152740dccaf0e89eeedccae45ad2e65adcdee85ac2eae8d605b1b604482015290519081900360640190fd5b600061243f6137ea565b9050600061244d8285613802565b9050600061245b838361394a565b509050306001600160a01b0316836001600160a01b0316638161b120846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156124ac57600080fd5b505afa1580156124c0573d6000803e3d6000fd5b505050506040513d60208110156124d657600080fd5b50516001600160a01b03161461251f576040805162461bcd60e51b81526020600482015260096024820152683737ba16b7bbb732b960b91b604482015290519081900360640190fd5b826001600160a01b031663fcafcc6883866040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050600060405180830381600087803b15801561257657600080fd5b505af115801561258a573d6000803e3d6000fd5b5050604080516001600160a01b038816815290518493508592507f3dafb03636e0da80483e5469aecccf1113e303099d12839886ec104e0636ee549181900360200190a360408051602081018490528082018390526001600160a01b0386166060828101919091528251808303909101815260809091019091527f3dafb03636e0da80483e5469aecccf1113e303099d12839886ec104e0636ee54906000806126316137e2565b9150915061263d613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156126ad578181015183820152602001612695565b50505050905090810190601f1680156126da5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156126fc57600080fd5b505af1158015612710573d6000803e3d6000fd5b50505050505050505050505050565b60006127296137ea565b905060006127378486613a6f565b9050600080612746848961394a565b915091506000612754613d28565b6001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561279757600080fd5b505afa1580156127ab573d6000803e3d6000fd5b505050506040513d60208110156127c157600080fd5b5051905080600060001986141561293657866001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561280b57600080fd5b505afa15801561281f573d6000803e3d6000fd5b505050506040513d602081101561283557600080fd5b50516040805163214414d560e01b8152600481018890526001600160a01b0387811660248301529151919092169163214414d5916044808301926020929190829003018186803b15801561288857600080fd5b505afa15801561289c573d6000803e3d6000fd5b505050506040513d60208110156128b257600080fd5b5051604080516359de7d4160e11b8152905191925061292f916001600160a01b0385169163b3bcfa829160048083019260209291908290030181600087803b1580156128fd57600080fd5b505af1158015612911573d6000803e3d6000fd5b505050506040513d602081101561292757600080fd5b505187613e3e565b95506129a9565b6129a6826001600160a01b031663b3bcfa826040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561297457600080fd5b505af1158015612988573d6000803e3d6000fd5b505050506040513d602081101561299e57600080fd5b505187613d72565b90505b604080516313771f0760e31b8152600481018d90523060248201526044810183905290516001600160a01b03891691639bb8f83891606480830192600092919082900301818387803b1580156129fe57600080fd5b505af1158015612a12573d6000803e3d6000fd5b505050506000826001600160a01b0316637bd2bea76040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612a5357600080fd5b505af1158015612a67573d6000803e3d6000fd5b505050506040513d6020811015612a7d57600080fd5b50516040805163ef693bed60e01b8152306004820152602481018a905290519192506001600160a01b0385169163ef693bed9160448082019260009290919082900301818387803b158015612ad157600080fd5b505af1158015612ae5573d6000803e3d6000fd5b50505050612af281613d40565b15612b5657806001600160a01b0316632e1a7d4d886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612b3d57600080fd5b505af1158015612b51573d6000803e3d6000fd5b505050505b612b608988613b27565b60408051888152602081018c90528082018b9052905187918e917f7d1a1a10927b49642644fb6a1d7a28e9efdff50f4f56543cdd932bbe818dc20b9181900360600190a360408051602081018e905280820188905260608101899052608081018c905260a08082018c90528251808303909101815260c09091019091527f7d1a1a10927b49642644fb6a1d7a28e9efdff50f4f56543cdd932bbe818dc20b9060008061158a6137e2565b6000612c146137ea565b90506000612c228486613a6f565b90506000612c308388613802565b9050600080612c3f858461394a565b915091506000856001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015612c7e57600080fd5b505afa158015612c92573d6000803e3d6000fd5b505050506040513d6020811015612ca857600080fd5b505190506000612cb9828585613e57565b90506000198614612cca5785612ccc565b805b955085811015612d18576040805162461bcd60e51b81526020600482015260126024820152711c185e5a5b99cb595e18d95cdccb5919589d60721b604482015290519081900360640190fd5b6000612d22613af8565b9050806001600160a01b031663f4b9fa756040518163ffffffff1660e01b8152600401602060405180830381600087803b158015612d5f57600080fd5b505af1158015612d73573d6000803e3d6000fd5b505050506040513d6020811015612d8957600080fd5b50516001600160a01b031663095ea7b3612da1613af8565b896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015612de857600080fd5b505af1158015612dfc573d6000803e3d6000fd5b50505050806001600160a01b0316633b4da69f85896040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015612e5757600080fd5b505af1158015612e6b573d6000803e3d6000fd5b50505050876001600160a01b03166345e6bdcd876000612f0587886001600160a01b0316636c25b3468b6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612ed257600080fd5b505afa158015612ee6573d6000803e3d6000fd5b505050506040513d6020811015612efc57600080fd5b50518a8c614024565b6040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050600060405180830381600087803b158015612f4957600080fd5b505af1158015612f5d573d6000803e3d6000fd5b50505050612f6b8988613b27565b60408051888152602081018c90528082018b90529051869188917fde62a5a99e6cbec0ce3c06281560c2e950f5e9749e8bcecb2e33d0918b5c42969181900360600190a3604080516020810188905280820187905260608101899052608081018c905260a08082018c90528251808303909101815260c09091019091527fde62a5a99e6cbec0ce3c06281560c2e950f5e9749e8bcecb2e33d0918b5c42969060008061158a6137e2565b600061301f613af8565b9050600061302d8486613a6f565b905060008290506000816001600160a01b03166336569e776040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561307157600080fd5b505af1158015613085573d6000803e3d6000fd5b505050506040513d602081101561309b57600080fd5b5051905060006130a9613dca565b90506000816001600160a01b0316639f678cca6040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156130e857600080fd5b505af11580156130fc573d6000803e3d6000fd5b505050506040513d602081101561311257600080fd5b5051905060006000198614156131bb57604080516305f5d64360e11b815230600482015290516001600160a01b03851691630bebac86916024808301926020929190829003018186803b15801561316857600080fd5b505afa15801561317c573d6000803e3d6000fd5b505050506040513d602081101561319257600080fd5b50519050676765c793fa10079d601b1b6131ac8383613de2565b816131b357fe5b0495506131dc565b816131d187676765c793fa10079d601b1b613de2565b816131d857fe5b0490505b826001600160a01b0316637f8661a1826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561322257600080fd5b505af1158015613236573d6000803e3d6000fd5b505050506000846001600160a01b0316636c25b346306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561328957600080fd5b505afa15801561329d573d6000803e3d6000fd5b505050506040513d60208110156132b357600080fd5b505160408051634538c4eb60e01b81523060048201526001600160a01b038b81166024830152915192935090871691634538c4eb91604480820192602092909190829003018186803b15801561330857600080fd5b505afa15801561331c573d6000803e3d6000fd5b505050506040513d602081101561333257600080fd5b50516133a057846001600160a01b031663a3b22fc4896040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561338757600080fd5b505af115801561339b573d6000803e3d6000fd5b505050505b856001600160a01b031663ef693bed306133c58a676765c793fa10079d601b1b613de2565b8410156133df57676765c793fa10079d601b1b84046133e1565b895b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561342757600080fd5b505af115801561343b573d6000803e3d6000fd5b505050506134498988613b27565b60408051888152602081018c90528082018b905290517f777e0947419ce926e4c968b17ebe2ab9300a139fe6d2dc884d736a0d9092e4a89181900360600190a160408051602081018990528082018c905260608181018c90528251808303909101815260809091019091527f777e0947419ce926e4c968b17ebe2ab9300a139fe6d2dc884d736a0d9092e4a890600080610baf6137e2565b60008061352384848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061415492505050565b9050600061352f613d28565b6001600160a01b0316634445d799836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561357257600080fd5b505afa158015613586573d6000803e3d6000fd5b505050506040513d602081101561359c57600080fd5b50516001600160a01b031614156135eb576040805162461bcd60e51b815260206004820152600e60248201526d77726f6e672d636f6c2d7479706560901b604482015290519081900360640190fd5b6135f36137ea565b6001600160a01b0316636090dec582306040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050602060405180830381600087803b15801561364957600080fd5b505af115801561365d573d6000803e3d6000fd5b505050506040513d602081101561367357600080fd5b5051604051909250819083907f27d82e3f86469d4c4bf87f285ea64e3f40763a52f70b95c6b2f818caf264ef7890600090a3604080516020810184905280820183905281518082038301815260609091019091527f27d82e3f86469d4c4bf87f285ea64e3f40763a52f70b95c6b2f818caf264ef78906000806136f46137e2565b91509150613700613a57565b6001600160a01b031663e14d4fb1838387876040518563ffffffff1660e01b81526004018085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015613770578181015183820152602001613758565b50505050905090810190601f16801561379d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156137bf57600080fd5b505af11580156137d3573d6000803e3d6000fd5b50505050505050505092915050565b600190601a90565b735ef30b9986345249bc32d8928b7ee64de9435e3990565b600081613941576000836001600160a01b03166305d85eda306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561385857600080fd5b505afa15801561386c573d6000803e3d6000fd5b505050506040513d602081101561388257600080fd5b5051116138c8576040805162461bcd60e51b815260206004820152600f60248201526e1b9bcb5d985d5b1d0b5bdc195b9959608a1b604482015290519081900360640190fd5b60408051639a816f7d60e01b815230600482015290516001600160a01b03851691639a816f7d916024808301926020929190829003018186803b15801561390e57600080fd5b505afa158015613922573d6000803e3d6000fd5b505050506040513d602081101561393857600080fd5b50519050613944565b50805b92915050565b600080836001600160a01b0316632c2cb9fd846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561399157600080fd5b505afa1580156139a5573d6000803e3d6000fd5b505050506040513d60208110156139bb57600080fd5b505160408051632726b07360e01b81526004810186905290519193506001600160a01b03861691632726b07391602480820192602092909190829003018186803b158015613a0857600080fd5b505afa158015613a1c573d6000803e3d6000fd5b505050506040513d6020811015613a3257600080fd5b5051919491935090915050565b734dd58550eb15190a5b3dfae28bb14eec181fc26790565b732af7ea6cb911035f3eb1ed895cb6692c39ecba9790565b6000821561394157613a7f6141a4565b6001600160a01b031663a9c70eaa846040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015613ac457600080fd5b505af1158015613ad8573d6000803e3d6000fd5b505050506040513d6020811015613aee57600080fd5b50515b9392505050565b739759a6ac90977b93b58547b4a71c78317f391a2890565b600061394482676765c793fa10079d601b1b613de2565b8115613b9b57613b356141a4565b6001600160a01b03166361e3c94483836040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015613b8257600080fd5b505af1158015613b96573d6000803e3d6000fd5b505050505b5050565b600080613baa6141bc565b90506000816001600160a01b03166344e2a5a8866040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015613bf457600080fd5b505af1158015613c08573d6000803e3d6000fd5b505050506040513d6020811015613c1e57600080fd5b505160408051633612d9a360e11b81526001600160a01b0389811660048301529151929350600092918a1691636c25b34691602480820192602092909190829003018186803b158015613c7057600080fd5b505afa158015613c84573d6000803e3d6000fd5b505050506040513d6020811015613c9a57600080fd5b50519050613cb385676765c793fa10079d601b1b613de2565b811015613d1d57613ce982613cdc613cd688676765c793fa10079d601b1b613de2565b846141d4565b81613ce357fe5b04613d84565b9350613d0085676765c793fa10079d601b1b613de2565b613d0a8584613de2565b10613d155783613d1a565b836001015b93505b505050949350505050565b73e81f70cc7c0d46e12d70efc60607f16bbd617e8890565b6000613d4a61421b565b6001600160a01b0316826001600160a01b031614613d69576000613944565b5060015b919050565b6000613af18284601203600a0a613de2565b806000811215613d6d576040805162461bcd60e51b815260206004820152600c60248201526b696e742d6f766572666c6f7760a01b604482015290519081900360640190fd5b73197e90f9fad81970ba7976f33cbd77088e5d7cf790565b6000811580613dfd57505080820282828281613dfa57fe5b04145b613944576040805162461bcd60e51b815260206004820152600d60248201526c6d6174682d6e6f742d7361666560981b604482015290519081900360640190fd5b600082601203600a0a8281613e4f57fe5b049392505050565b600080846001600160a01b031663d9638d36856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b158015613e9e57600080fd5b505afa158015613eb2573d6000803e3d6000fd5b505050506040513d60a0811015613ec857600080fd5b5060200151604080516309092f9760e21b8152600481018790526001600160a01b038681166024830152825193945060009390891692632424be5c9260448082019391829003018186803b158015613f1f57600080fd5b505afa158015613f33573d6000803e3d6000fd5b505050506040513d6040811015613f4957600080fd5b5060209081015160408051633612d9a360e11b81526001600160a01b0388811660048301529151929450600093918a1692636c25b34692602480840193919291829003018186803b158015613f9d57600080fd5b505afa158015613fb1573d6000803e3d6000fd5b505050506040513d6020811015613fc757600080fd5b505190506000613fe0613fda8486613de2565b836141d4565b9050676765c793fa10079d601b1b810494508061400886676765c793fa10079d601b1b613de2565b106140135784614018565b846001015b98975050505050505050565b600080856001600160a01b031663d9638d36846040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b15801561406b57600080fd5b505afa15801561407f573d6000803e3d6000fd5b505050506040513d60a081101561409557600080fd5b5060200151604080516309092f9760e21b8152600481018690526001600160a01b0387811660248301528251939450600093908a1692632424be5c9260448082019391829003018186803b1580156140ec57600080fd5b505afa158015614100573d6000803e3d6000fd5b505050506040513d604081101561411657600080fd5b50602001519050614129828781613ce357fe5b9250808311156141445761413c81613d84565b600003614149565b826000035b979650505050505050565b600081516000141561419c576040805162461bcd60e51b815260206004820152600c60248201526b737472696e672d656d70747960a01b604482015290519081900360640190fd5b506020015190565b738a5419cfc711b2343c17a6abf4b2bafabb06957f90565b7319c0976f590d67707e62397c87829d896dc0f1f190565b80820382811115613944576040805162461bcd60e51b815260206004820152600c60248201526b7375622d6f766572666c6f7760a01b604482015290519081900360640190fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29056fea2646970667358221220a08939b10c28b00ad60dcf3da607bd5a8dcadc1d3efa2c042d1a3933080b44dd64736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/IERC20.json b/pre-compiles/IERC20.json new file mode 100644 index 0000000..805c768 --- /dev/null +++ b/pre-compiles/IERC20.json @@ -0,0 +1,192 @@ +{ + "contractName": "IERC20", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "who", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/IUniswapExchange.json b/pre-compiles/IUniswapExchange.json new file mode 100644 index 0000000..7c47ffc --- /dev/null +++ b/pre-compiles/IUniswapExchange.json @@ -0,0 +1,318 @@ +{ + "contractName": "IUniswapExchange", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "MintTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "ethToTokenSwapInput", + "outputs": [ + { + "internalType": "uint256", + "name": "tokensBought", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens_bought", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "ethToTokenSwapOutput", + "outputs": [ + { + "internalType": "uint256", + "name": "tokensSold", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "MintTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "ethToTokenTransferInput", + "outputs": [ + { + "internalType": "uint256", + "name": "tokensBought", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "ethSold", + "type": "uint256" + } + ], + "name": "getEthToTokenInputPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "tokensBought", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSold", + "type": "uint256" + } + ], + "name": "getTokenToEthInputPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "ethBought", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "ethbought", + "type": "uint256" + } + ], + "name": "getTokenToEthOutputPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "tokensToBeSold", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens_sold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min_eth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "tokenToEthSwapInput", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "eth_bought", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max_tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "tokenToEthSwapOutput", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens_sold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min_eth", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "tokenToEthTransferInput", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensSold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "MintTokensBought", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minEthBought", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddr", + "type": "address" + } + ], + "name": "tokenToTokenSwapInput", + "outputs": [ + { + "internalType": "uint256", + "name": "tokensBought", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens_sold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min_tokens_bought", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min_eth_bought", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "address", + "name": "token_addr", + "type": "address" + } + ], + "name": "tokenToTokenTransferInput", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/InstaAccount.json b/pre-compiles/InstaAccount.json new file mode 100644 index 0000000..7e36844 --- /dev/null +++ b/pre-compiles/InstaAccount.json @@ -0,0 +1,197 @@ +{ + "contractName": "InstaAccount", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "origin", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "LogCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "LogDisable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "LogEnable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "_shield", + "type": "bool" + } + ], + "name": "LogSwitchShield", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "_datas", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_origin", + "type": "address" + } + ], + "name": "cast", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "disable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "enable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "instaIndex", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "isAuth", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "shield", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "_shield", + "type": "bool" + } + ], + "name": "switchShield", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610ed5806100206000396000f3fe60806040526004361061007f5760003560e01c806370d39cff1161004e57806370d39cff14610125578063a41098bf1461013a578063e0e90acf1461015c578063e6c09edf1461016f57610086565b80632520e7ff1461008b578063501b9b67146100c157806354fd4d50146100e35780635bfa1b681461010557610086565b3661008657005b600080fd5b34801561009757600080fd5b506100ab6100a6366004610ae9565b61018f565b6040516100b89190610c43565b60405180910390f35b3480156100cd57600080fd5b506100e16100dc366004610ba9565b6101ad565b005b3480156100ef57600080fd5b506100f861025d565b6040516100b89190610e2b565b34801561011157600080fd5b506100e1610120366004610ae9565b610262565b34801561013157600080fd5b506100ab61040a565b34801561014657600080fd5b5061014f610413565b6040516100b89190610be1565b6100e161016a366004610b28565b610418565b34801561017b57600080fd5b506100e161018a366004610ae9565b6108b3565b6001600160a01b031660009081526020819052604090205460ff1690565b3360009081526020819052604090205460ff166101e55760405162461bcd60e51b81526004016101dc90610d69565b60405180910390fd5b60015460ff161515811515141561020e5760405162461bcd60e51b81526004016101dc90610e04565b6001805460ff191682151517908190556040517f38a4860f1db0d5ebd83e321dae638039485f74aca43265d0772f95ac9267830d916102529160ff90911690610c43565b60405180910390a150565b600181565b3330148061026e575033155b61028a5760405162461bcd60e51b81526004016101dc90610c9f565b6001600160a01b0381166102b05760405162461bcd60e51b81526004016101dc90610c4e565b6001600160a01b03811660009081526020819052604090205460ff16156102e95760405162461bcd60e51b81526004016101dc90610d40565b6001600160a01b038116600090815260208181526040808320805460ff191660011790558051630f560cd760e01b81529051630f560cd792600480840193919291829003018186803b15801561033e57600080fd5b505afa158015610352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103769190610b0c565b6001600160a01b0316635422224e826040518263ffffffff1660e01b81526004016103a19190610be1565b600060405180830381600087803b1580156103bb57600080fd5b505af11580156103cf573d6000803e3d6000fd5b50506040516001600160a01b03841692507fdc949ee4159e00c6f6c0277af4718b4329c1e113164f629e30029915196c530f9150600090a250565b60015460ff1681565b600081565b6104213361018f565b8061042a575033155b6104465760405162461bcd60e51b81526004016101dc90610dd9565b8382146104655760405162461bcd60e51b81526004016101dc90610c71565b60015460009060ff168061058e576040516313ede1a160e01b81526001600160a01b038316906313ede1a1906104a090600190600401610e2b565b60206040518083038186803b1580156104b857600080fd5b505afa1580156104cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f09190610b0c565b6001600160a01b031663a829f16588886040518363ffffffff1660e01b815260040161051d929190610bf5565b60206040518083038186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056d9190610bc5565b6105895760405162461bcd60e51b81526004016101dc90610cc7565b6106a4565b6040516313ede1a160e01b81526001600160a01b038316906313ede1a1906105bb90600190600401610e2b565b60206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b9190610b0c565b6001600160a01b031663144c61fe88886040518363ffffffff1660e01b8152600401610638929190610bf5565b60206040518083038186803b15801561065057600080fd5b505afa158015610664573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106889190610bc5565b6106a45760405162461bcd60e51b81526004016101dc90610dab565b60005b868110156107335761072b8888838181106106be57fe5b90506020020160208101906106d39190610ae9565b8787848181106106df57fe5b90506020028101906106f19190610e34565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a4e92505050565b6001016106a7565b506040516305f72f4560e41b81526000906001600160a01b03841690635f72f4509061076490600190600401610e2b565b60206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b49190610b0c565b90506001600160a01b038116158015906107cc575081155b1561085e57806001600160a01b031663d957dd3c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561080a57600080fd5b505afa15801561081e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108429190610bc5565b61085e5760405162461bcd60e51b81526004016101dc90610d8b565b336001600160a01b0316846001600160a01b03167f88c16fce368c171f39a2eb45acade4f8e2316d6c47b08e53f941ca3f90bc6ef2346040516108a19190610e2b565b60405180910390a35050505050505050565b3330146108d25760405162461bcd60e51b81526004016101dc90610d69565b6001600160a01b0381166108f85760405162461bcd60e51b81526004016101dc90610c4e565b6001600160a01b03811660009081526020819052604090205460ff166109305760405162461bcd60e51b81526004016101dc90610d16565b6001600160a01b038116600090815260208181526040808320805460ff191690558051630f560cd760e01b81529051630f560cd792600480840193919291829003018186803b15801561098257600080fd5b505afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190610b0c565b6001600160a01b0316637f3fd918826040518263ffffffff1660e01b81526004016109e59190610be1565b600060405180830381600087803b1580156109ff57600080fd5b505af1158015610a13573d6000803e3d6000fd5b50506040516001600160a01b03841692507f388f3d05458eb2a997e29ad87ebff76b4482e8c12f760c04a84243c9907af6cc9150600090a250565b6001600160a01b038216610a745760405162461bcd60e51b81526004016101dc90610cee565b600080825160208401855af4801560018114610a8f57610a9a565b3d806000803e806000fd5b50505050565b60008083601f840112610ab1578182fd5b50813567ffffffffffffffff811115610ac8578182fd5b6020830191508360208083028501011115610ae257600080fd5b9250929050565b600060208284031215610afa578081fd5b8135610b0581610e79565b9392505050565b600060208284031215610b1d578081fd5b8151610b0581610e79565b600080600080600060608688031215610b3f578081fd5b853567ffffffffffffffff80821115610b56578283fd5b610b6289838a01610aa0565b90975095506020880135915080821115610b7a578283fd5b50610b8788828901610aa0565b9094509250506040860135610b9b81610e79565b809150509295509295909350565b600060208284031215610bba578081fd5b8135610b0581610e91565b600060208284031215610bd6578081fd5b8151610b0581610e91565b6001600160a01b0391909116815260200190565b60208082528181018390526000908460408401835b86811015610c38578235610c1d81610e79565b6001600160a01b031682529183019190830190600101610c0a565b509695505050505050565b901515815260200190565b6020808252600990820152681b9bdd0b5d985b1a5960ba1b604082015260600190565b602080825260149082015273185c9c985e4b5b195b99dd1a0b5a5b9d985b1a5960621b604082015260600190565b6020808252600e908201526d0dcdee85ae6cad8cc5ad2dcc8caf60931b604082015260600190565b6020808252600d908201526c3737ba16b1b7b73732b1ba37b960991b604082015260600190565b6020808252600e908201526d1d185c99d95d0b5a5b9d985b1a5960921b604082015260600190565b60208082526010908201526f185b1c9958591e4b591a5cd8589b195960821b604082015260600190565b6020808252600f908201526e185b1c9958591e4b595b98589b1959608a1b604082015260600190565b6020808252600890820152673737ba16b9b2b63360c11b604082015260600190565b6020808252600690820152656e6f742d6f6b60d01b604082015260600190565b6020808252601490820152733737ba16b9ba30ba34b196b1b7b73732b1ba37b960611b604082015260600190565b6020808252601190820152701c195c9b5a5cdcda5bdb8b59195b9a5959607a1b604082015260600190565b6020808252600d908201526c1cda1a595b19081a5cc81cd95d609a1b604082015260600190565b90815260200190565b6000808335601e19843603018112610e4a578283fd5b83018035915067ffffffffffffffff821115610e64578283fd5b602001915036819003821315610ae257600080fd5b6001600160a01b0381168114610e8e57600080fd5b50565b8015158114610e8e57600080fdfea2646970667358221220dab0d709c029d38b0ffd0ac8adc90e297884e43a5c5ece8a8cb7e5cbd0a8629f64736f6c634300060c0033", + "deployedBytecode": "0x60806040526004361061007f5760003560e01c806370d39cff1161004e57806370d39cff14610125578063a41098bf1461013a578063e0e90acf1461015c578063e6c09edf1461016f57610086565b80632520e7ff1461008b578063501b9b67146100c157806354fd4d50146100e35780635bfa1b681461010557610086565b3661008657005b600080fd5b34801561009757600080fd5b506100ab6100a6366004610ae9565b61018f565b6040516100b89190610c43565b60405180910390f35b3480156100cd57600080fd5b506100e16100dc366004610ba9565b6101ad565b005b3480156100ef57600080fd5b506100f861025d565b6040516100b89190610e2b565b34801561011157600080fd5b506100e1610120366004610ae9565b610262565b34801561013157600080fd5b506100ab61040a565b34801561014657600080fd5b5061014f610413565b6040516100b89190610be1565b6100e161016a366004610b28565b610418565b34801561017b57600080fd5b506100e161018a366004610ae9565b6108b3565b6001600160a01b031660009081526020819052604090205460ff1690565b3360009081526020819052604090205460ff166101e55760405162461bcd60e51b81526004016101dc90610d69565b60405180910390fd5b60015460ff161515811515141561020e5760405162461bcd60e51b81526004016101dc90610e04565b6001805460ff191682151517908190556040517f38a4860f1db0d5ebd83e321dae638039485f74aca43265d0772f95ac9267830d916102529160ff90911690610c43565b60405180910390a150565b600181565b3330148061026e575033155b61028a5760405162461bcd60e51b81526004016101dc90610c9f565b6001600160a01b0381166102b05760405162461bcd60e51b81526004016101dc90610c4e565b6001600160a01b03811660009081526020819052604090205460ff16156102e95760405162461bcd60e51b81526004016101dc90610d40565b6001600160a01b038116600090815260208181526040808320805460ff191660011790558051630f560cd760e01b81529051630f560cd792600480840193919291829003018186803b15801561033e57600080fd5b505afa158015610352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103769190610b0c565b6001600160a01b0316635422224e826040518263ffffffff1660e01b81526004016103a19190610be1565b600060405180830381600087803b1580156103bb57600080fd5b505af11580156103cf573d6000803e3d6000fd5b50506040516001600160a01b03841692507fdc949ee4159e00c6f6c0277af4718b4329c1e113164f629e30029915196c530f9150600090a250565b60015460ff1681565b600081565b6104213361018f565b8061042a575033155b6104465760405162461bcd60e51b81526004016101dc90610dd9565b8382146104655760405162461bcd60e51b81526004016101dc90610c71565b60015460009060ff168061058e576040516313ede1a160e01b81526001600160a01b038316906313ede1a1906104a090600190600401610e2b565b60206040518083038186803b1580156104b857600080fd5b505afa1580156104cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f09190610b0c565b6001600160a01b031663a829f16588886040518363ffffffff1660e01b815260040161051d929190610bf5565b60206040518083038186803b15801561053557600080fd5b505afa158015610549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056d9190610bc5565b6105895760405162461bcd60e51b81526004016101dc90610cc7565b6106a4565b6040516313ede1a160e01b81526001600160a01b038316906313ede1a1906105bb90600190600401610e2b565b60206040518083038186803b1580156105d357600080fd5b505afa1580156105e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060b9190610b0c565b6001600160a01b031663144c61fe88886040518363ffffffff1660e01b8152600401610638929190610bf5565b60206040518083038186803b15801561065057600080fd5b505afa158015610664573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106889190610bc5565b6106a45760405162461bcd60e51b81526004016101dc90610dab565b60005b868110156107335761072b8888838181106106be57fe5b90506020020160208101906106d39190610ae9565b8787848181106106df57fe5b90506020028101906106f19190610e34565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610a4e92505050565b6001016106a7565b506040516305f72f4560e41b81526000906001600160a01b03841690635f72f4509061076490600190600401610e2b565b60206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b49190610b0c565b90506001600160a01b038116158015906107cc575081155b1561085e57806001600160a01b031663d957dd3c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561080a57600080fd5b505afa15801561081e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108429190610bc5565b61085e5760405162461bcd60e51b81526004016101dc90610d8b565b336001600160a01b0316846001600160a01b03167f88c16fce368c171f39a2eb45acade4f8e2316d6c47b08e53f941ca3f90bc6ef2346040516108a19190610e2b565b60405180910390a35050505050505050565b3330146108d25760405162461bcd60e51b81526004016101dc90610d69565b6001600160a01b0381166108f85760405162461bcd60e51b81526004016101dc90610c4e565b6001600160a01b03811660009081526020819052604090205460ff166109305760405162461bcd60e51b81526004016101dc90610d16565b6001600160a01b038116600090815260208181526040808320805460ff191690558051630f560cd760e01b81529051630f560cd792600480840193919291829003018186803b15801561098257600080fd5b505afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190610b0c565b6001600160a01b0316637f3fd918826040518263ffffffff1660e01b81526004016109e59190610be1565b600060405180830381600087803b1580156109ff57600080fd5b505af1158015610a13573d6000803e3d6000fd5b50506040516001600160a01b03841692507f388f3d05458eb2a997e29ad87ebff76b4482e8c12f760c04a84243c9907af6cc9150600090a250565b6001600160a01b038216610a745760405162461bcd60e51b81526004016101dc90610cee565b600080825160208401855af4801560018114610a8f57610a9a565b3d806000803e806000fd5b50505050565b60008083601f840112610ab1578182fd5b50813567ffffffffffffffff811115610ac8578182fd5b6020830191508360208083028501011115610ae257600080fd5b9250929050565b600060208284031215610afa578081fd5b8135610b0581610e79565b9392505050565b600060208284031215610b1d578081fd5b8151610b0581610e79565b600080600080600060608688031215610b3f578081fd5b853567ffffffffffffffff80821115610b56578283fd5b610b6289838a01610aa0565b90975095506020880135915080821115610b7a578283fd5b50610b8788828901610aa0565b9094509250506040860135610b9b81610e79565b809150509295509295909350565b600060208284031215610bba578081fd5b8135610b0581610e91565b600060208284031215610bd6578081fd5b8151610b0581610e91565b6001600160a01b0391909116815260200190565b60208082528181018390526000908460408401835b86811015610c38578235610c1d81610e79565b6001600160a01b031682529183019190830190600101610c0a565b509695505050505050565b901515815260200190565b6020808252600990820152681b9bdd0b5d985b1a5960ba1b604082015260600190565b602080825260149082015273185c9c985e4b5b195b99dd1a0b5a5b9d985b1a5960621b604082015260600190565b6020808252600e908201526d0dcdee85ae6cad8cc5ad2dcc8caf60931b604082015260600190565b6020808252600d908201526c3737ba16b1b7b73732b1ba37b960991b604082015260600190565b6020808252600e908201526d1d185c99d95d0b5a5b9d985b1a5960921b604082015260600190565b60208082526010908201526f185b1c9958591e4b591a5cd8589b195960821b604082015260600190565b6020808252600f908201526e185b1c9958591e4b595b98589b1959608a1b604082015260600190565b6020808252600890820152673737ba16b9b2b63360c11b604082015260600190565b6020808252600690820152656e6f742d6f6b60d01b604082015260600190565b6020808252601490820152733737ba16b9ba30ba34b196b1b7b73732b1ba37b960611b604082015260600190565b6020808252601190820152701c195c9b5a5cdcda5bdb8b59195b9a5959607a1b604082015260600190565b6020808252600d908201526c1cda1a595b19081a5cc81cd95d609a1b604082015260600190565b90815260200190565b6000808335601e19843603018112610e4a578283fd5b83018035915067ffffffffffffffff821115610e64578283fd5b602001915036819003821315610ae257600080fd5b6001600160a01b0381168114610e8e57600080fd5b50565b8015158114610e8e57600080fdfea2646970667358221220dab0d709c029d38b0ffd0ac8adc90e297884e43a5c5ece8a8cb7e5cbd0a8629f64736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/InstaConnectors.json b/pre-compiles/InstaConnectors.json new file mode 100644 index 0000000..daeb1ef --- /dev/null +++ b/pre-compiles/InstaConnectors.json @@ -0,0 +1,324 @@ +{ + "contractName": "InstaConnectors", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "LogAddController", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "connector", + "type": "address" + } + ], + "name": "LogDisable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "connector", + "type": "address" + } + ], + "name": "LogEnable", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "connector", + "type": "address" + } + ], + "name": "LogEnableStatic", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "LogRemoveController", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "chief", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "connectorArray", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "connectorCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "connectorLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "connectors", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_connector", + "type": "address" + } + ], + "name": "disable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_userAddress", + "type": "address" + } + ], + "name": "disableChief", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_connector", + "type": "address" + } + ], + "name": "enable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_userAddress", + "type": "address" + } + ], + "name": "enableChief", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_connector", + "type": "address" + } + ], + "name": "enableStatic", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "instaIndex", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_connectors", + "type": "address[]" + } + ], + "name": "isConnector", + "outputs": [ + { + "internalType": "bool", + "name": "isOk", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_connectors", + "type": "address[]" + } + ], + "name": "isStaticConnector", + "outputs": [ + { + "internalType": "bool", + "name": "isOk", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "staticConnectorArray", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "staticConnectorLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "staticConnectors", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506110ee806100206000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806378ba255811610097578063ae15e02c11610066578063ae15e02c1461033e578063cc712c2314610364578063e6c09edf1461036c578063f2e180491461039257610100565b806378ba25581461029a578063a41098bf146102a2578063a829f165146102aa578063ac3f83341461031857610100565b80632e1fbdce116100d35780632e1fbdce1461020e5780635bfa1b681461022857806361f827801461024e5780636b1056ae1461027457610100565b80630867fa45146101055780630e53aae91461013e5780630f70d4a714610178578063144c61fe146101a0575b600080fd5b6101226004803603602081101561011b57600080fd5b50356103af565b604080516001600160a01b039092168252519081900360200190f35b6101646004803603602081101561015457600080fd5b50356001600160a01b03166103d6565b604080519115158252519081900360200190f35b61019e6004803603602081101561018e57600080fd5b50356001600160a01b03166103eb565b005b610164600480360360208110156101b657600080fd5b810190602081018135600160201b8111156101d057600080fd5b8201836020820111156101e257600080fd5b803590602001918460208302840111600160201b8311171561020357600080fd5b509092509050610502565b610216610561565b60408051918252519081900360200190f35b61019e6004803603602081101561023e57600080fd5b50356001600160a01b0316610567565b61019e6004803603602081101561026457600080fd5b50356001600160a01b03166106f2565b6101646004803603602081101561028a57600080fd5b50356001600160a01b0316610806565b61021661081b565b610122610821565b610164600480360360208110156102c057600080fd5b810190602081018135600160201b8111156102da57600080fd5b8201836020820111156102ec57600080fd5b803590602001918460208302840111600160201b8311171561030d57600080fd5b509092509050610826565b6101646004803603602081101561032e57600080fd5b50356001600160a01b031661087e565b61019e6004803603602081101561035457600080fd5b50356001600160a01b0316610893565b610216610a13565b61019e6004803603602081101561038257600080fd5b50356001600160a01b0316610a19565b610122600480360360208110156103a857600080fd5b5035610b97565b600381815481106103bc57fe5b6000918252602090912001546001600160a01b0316905081565b60016020526000908152604090205460ff1681565b3360009081526020819052604090205460ff1680610476575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b15801561043e57600080fd5b505afa158015610452573d6000803e3d6000fd5b505050506040513d602081101561046857600080fd5b50516001600160a01b031633145b6104b6576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f69483bb868dc7929bac7b0735c53b685aeb5438761d41d189fbcdde8011b27979190a250565b600160005b8281101561055a576002600085858481811061051f57fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610552576000915061055a565b600101610507565b5092915050565b60055490565b3360009081526020819052604090205460ff16806105f2575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156105ba57600080fd5b505afa1580156105ce573d6000803e3d6000fd5b505050506040513d60208110156105e457600080fd5b50516001600160a01b031633145b610632576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b03811660009081526001602052604090205460ff1615610692576040805162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b595b98589b1959608a1b604482015290519081900360640190fd5b61069b81610ba4565b6001600160a01b0381166000818152600160208190526040808320805460ff19168317905560048054909201909155517fdc949ee4159e00c6f6c0277af4718b4329c1e113164f629e30029915196c530f9190a250565b3360009081526020819052604090205460ff168061077d575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b15801561074557600080fd5b505afa158015610759573d6000803e3d6000fd5b505050506040513d602081101561076f57600080fd5b50516001600160a01b031633145b6107bd576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220805460ff19169055517fb28f1bf5635ec9671f4b88cd6b50e297659dbdfbbe1dc45069e9844ec07a21a19190a250565b60006020819052908152604090205460ff1681565b60045481565b600081565b600160005b8281101561055a576001600085858481811061084357fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610876576000915061055a565b60010161082b565b60026020526000908152604090205460ff1681565b3360009081526020819052604090205460ff168061091e575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e657600080fd5b505afa1580156108fa573d6000803e3d6000fd5b505050506040513d602081101561091057600080fd5b50516001600160a01b031633145b61095e576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109be576040805162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b595b98589b1959608a1b604482015290519081900360640190fd5b6109c781610e2e565b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517fd1f70568663bd9b4f99ababac3441804970c24aacb20e350d5e0d7b14c5cdb249190a250565b60035490565b3360009081526020819052604090205460ff1680610aa4575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d6020811015610a9657600080fd5b50516001600160a01b031633145b610ae4576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b03811660009081526001602052604090205460ff16610b44576040805162461bcd60e51b815260206004820152601060248201526f185b1c9958591e4b591a5cd8589b195960821b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff1916905560048054600019019055517f388f3d05458eb2a997e29ad87ebff76b4482e8c12f760c04a84243c9907af6cc9190a250565b600581815481106103bc57fe5b6001600160a01b038116610bf5576040805162461bcd60e51b81526020600482015260136024820152722737ba16bb30b634b216b1b7b73732b1ba37b960691b604482015290519081900360640190fd5b6000816001600160a01b031663eb15f7816040518163ffffffff1660e01b8152600401604080518083038186803b158015610c2f57600080fd5b505afa158015610c43573d6000803e3d6000fd5b505050506040513d6040811015610c5957600080fd5b50602001516003549091506001018114610cb5576040805162461bcd60e51b8152602060048201526018602482015277086dedcdccac6e8dee492885ac8decae6dce85adac2e8c6d60431b604482015290519081900360640190fd5b816001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610cee57600080fd5b505afa158015610d02573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610d2b57600080fd5b8101908080516040519392919084600160201b821115610d4a57600080fd5b908301906020820185811115610d5f57600080fd5b8251600160201b811182820188101715610d7857600080fd5b82525081516020918201929091019080838360005b83811015610da5578181015183820152602001610d8d565b50505050905090810190601f168015610dd25780820380516001836020036101000a031916815260200191505b506040525050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319166001600160a01b039590951694909417909355505050565b6001600160a01b038116610e7f576040805162461bcd60e51b81526020600482015260136024820152722737ba16bb30b634b216b1b7b73732b1ba37b960691b604482015290519081900360640190fd5b6000816001600160a01b031663eb15f7816040518163ffffffff1660e01b8152600401604080518083038186803b158015610eb957600080fd5b505afa158015610ecd573d6000803e3d6000fd5b505050506040513d6040811015610ee357600080fd5b50602001516005549091506001018114610f3f576040805162461bcd60e51b8152602060048201526018602482015277086dedcdccac6e8dee492885ac8decae6dce85adac2e8c6d60431b604482015290519081900360640190fd5b816001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610f7857600080fd5b505afa158015610f8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610fb557600080fd5b8101908080516040519392919084600160201b821115610fd457600080fd5b908301906020820185811115610fe957600080fd5b8251600160201b81118282018810171561100257600080fd5b82525081516020918201929091019080838360005b8381101561102f578181015183820152602001611017565b50505050905090810190601f16801561105c5780820380516001836020036101000a031916815260200191505b506040525050600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b03959095169490941790935550505056fea2646970667358221220d5ce06ff3c9186f98250d3e9880beeb21fa7d4a099f494bda7c764be6cbfc1c564736f6c634300060c0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101005760003560e01c806378ba255811610097578063ae15e02c11610066578063ae15e02c1461033e578063cc712c2314610364578063e6c09edf1461036c578063f2e180491461039257610100565b806378ba25581461029a578063a41098bf146102a2578063a829f165146102aa578063ac3f83341461031857610100565b80632e1fbdce116100d35780632e1fbdce1461020e5780635bfa1b681461022857806361f827801461024e5780636b1056ae1461027457610100565b80630867fa45146101055780630e53aae91461013e5780630f70d4a714610178578063144c61fe146101a0575b600080fd5b6101226004803603602081101561011b57600080fd5b50356103af565b604080516001600160a01b039092168252519081900360200190f35b6101646004803603602081101561015457600080fd5b50356001600160a01b03166103d6565b604080519115158252519081900360200190f35b61019e6004803603602081101561018e57600080fd5b50356001600160a01b03166103eb565b005b610164600480360360208110156101b657600080fd5b810190602081018135600160201b8111156101d057600080fd5b8201836020820111156101e257600080fd5b803590602001918460208302840111600160201b8311171561020357600080fd5b509092509050610502565b610216610561565b60408051918252519081900360200190f35b61019e6004803603602081101561023e57600080fd5b50356001600160a01b0316610567565b61019e6004803603602081101561026457600080fd5b50356001600160a01b03166106f2565b6101646004803603602081101561028a57600080fd5b50356001600160a01b0316610806565b61021661081b565b610122610821565b610164600480360360208110156102c057600080fd5b810190602081018135600160201b8111156102da57600080fd5b8201836020820111156102ec57600080fd5b803590602001918460208302840111600160201b8311171561030d57600080fd5b509092509050610826565b6101646004803603602081101561032e57600080fd5b50356001600160a01b031661087e565b61019e6004803603602081101561035457600080fd5b50356001600160a01b0316610893565b610216610a13565b61019e6004803603602081101561038257600080fd5b50356001600160a01b0316610a19565b610122600480360360208110156103a857600080fd5b5035610b97565b600381815481106103bc57fe5b6000918252602090912001546001600160a01b0316905081565b60016020526000908152604090205460ff1681565b3360009081526020819052604090205460ff1680610476575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b15801561043e57600080fd5b505afa158015610452573d6000803e3d6000fd5b505050506040513d602081101561046857600080fd5b50516001600160a01b031633145b6104b6576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220805460ff19166001179055517f69483bb868dc7929bac7b0735c53b685aeb5438761d41d189fbcdde8011b27979190a250565b600160005b8281101561055a576002600085858481811061051f57fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610552576000915061055a565b600101610507565b5092915050565b60055490565b3360009081526020819052604090205460ff16806105f2575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156105ba57600080fd5b505afa1580156105ce573d6000803e3d6000fd5b505050506040513d60208110156105e457600080fd5b50516001600160a01b031633145b610632576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b03811660009081526001602052604090205460ff1615610692576040805162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b595b98589b1959608a1b604482015290519081900360640190fd5b61069b81610ba4565b6001600160a01b0381166000818152600160208190526040808320805460ff19168317905560048054909201909155517fdc949ee4159e00c6f6c0277af4718b4329c1e113164f629e30029915196c530f9190a250565b3360009081526020819052604090205460ff168061077d575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b15801561074557600080fd5b505afa158015610759573d6000803e3d6000fd5b505050506040513d602081101561076f57600080fd5b50516001600160a01b031633145b6107bd576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220805460ff19169055517fb28f1bf5635ec9671f4b88cd6b50e297659dbdfbbe1dc45069e9844ec07a21a19190a250565b60006020819052908152604090205460ff1681565b60045481565b600081565b600160005b8281101561055a576001600085858481811061084357fe5b602090810292909201356001600160a01b03168352508101919091526040016000205460ff16610876576000915061055a565b60010161082b565b60026020526000908152604090205460ff1681565b3360009081526020819052604090205460ff168061091e575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e657600080fd5b505afa1580156108fa573d6000803e3d6000fd5b505050506040513d602081101561091057600080fd5b50516001600160a01b031633145b61095e576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109be576040805162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b595b98589b1959608a1b604482015290519081900360640190fd5b6109c781610e2e565b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517fd1f70568663bd9b4f99ababac3441804970c24aacb20e350d5e0d7b14c5cdb249190a250565b60035490565b3360009081526020819052604090205460ff1680610aa4575060006001600160a01b031663ee97f7f36040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d6020811015610a9657600080fd5b50516001600160a01b031633145b610ae4576040805162461bcd60e51b815260206004820152600c60248201526b3737ba16b0b716b1b434b2b360a11b604482015290519081900360640190fd5b6001600160a01b03811660009081526001602052604090205460ff16610b44576040805162461bcd60e51b815260206004820152601060248201526f185b1c9958591e4b591a5cd8589b195960821b604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff1916905560048054600019019055517f388f3d05458eb2a997e29ad87ebff76b4482e8c12f760c04a84243c9907af6cc9190a250565b600581815481106103bc57fe5b6001600160a01b038116610bf5576040805162461bcd60e51b81526020600482015260136024820152722737ba16bb30b634b216b1b7b73732b1ba37b960691b604482015290519081900360640190fd5b6000816001600160a01b031663eb15f7816040518163ffffffff1660e01b8152600401604080518083038186803b158015610c2f57600080fd5b505afa158015610c43573d6000803e3d6000fd5b505050506040513d6040811015610c5957600080fd5b50602001516003549091506001018114610cb5576040805162461bcd60e51b8152602060048201526018602482015277086dedcdccac6e8dee492885ac8decae6dce85adac2e8c6d60431b604482015290519081900360640190fd5b816001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610cee57600080fd5b505afa158015610d02573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610d2b57600080fd5b8101908080516040519392919084600160201b821115610d4a57600080fd5b908301906020820185811115610d5f57600080fd5b8251600160201b811182820188101715610d7857600080fd5b82525081516020918201929091019080838360005b83811015610da5578181015183820152602001610d8d565b50505050905090810190601f168015610dd25780820380516001836020036101000a031916815260200191505b506040525050600380546001810182556000919091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319166001600160a01b039590951694909417909355505050565b6001600160a01b038116610e7f576040805162461bcd60e51b81526020600482015260136024820152722737ba16bb30b634b216b1b7b73732b1ba37b960691b604482015290519081900360640190fd5b6000816001600160a01b031663eb15f7816040518163ffffffff1660e01b8152600401604080518083038186803b158015610eb957600080fd5b505afa158015610ecd573d6000803e3d6000fd5b505050506040513d6040811015610ee357600080fd5b50602001516005549091506001018114610f3f576040805162461bcd60e51b8152602060048201526018602482015277086dedcdccac6e8dee492885ac8decae6dce85adac2e8c6d60431b604482015290519081900360640190fd5b816001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610f7857600080fd5b505afa158015610f8c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015610fb557600080fd5b8101908080516040519392919084600160201b821115610fd457600080fd5b908301906020820185811115610fe957600080fd5b8251600160201b81118282018810171561100257600080fd5b82525081516020918201929091019080838360005b8381101561102f578181015183820152602001611017565b50505050905090810190601f16801561105c5780820380516001836020036101000a031916815260200191505b506040525050600580546001810182556000919091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b03959095169490941790935550505056fea2646970667358221220d5ce06ff3c9186f98250d3e9880beeb21fa7d4a099f494bda7c764be6cbfc1c564736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/InstaIndex.json b/pre-compiles/InstaIndex.json new file mode 100644 index 0000000..b758c07 --- /dev/null +++ b/pre-compiles/InstaIndex.json @@ -0,0 +1,387 @@ +{ + "contractName": "InstaIndex", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "origin", + "type": "address" + } + ], + "name": "LogAccountCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_newAccount", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_connectors", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "_check", + "type": "address" + } + ], + "name": "LogNewAccount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "accountVersion", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "check", + "type": "address" + } + ], + "name": "LogNewCheck", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "master", + "type": "address" + } + ], + "name": "LogNewMaster", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "master", + "type": "address" + } + ], + "name": "LogUpdateMaster", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "account", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newAccount", + "type": "address" + }, + { + "internalType": "address", + "name": "_connectors", + "type": "address" + }, + { + "internalType": "address", + "name": "_check", + "type": "address" + } + ], + "name": "addNewAccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "accountVersion", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_origin", + "type": "address" + } + ], + "name": "build", + "outputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "accountVersion", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "_targets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "_datas", + "type": "bytes[]" + }, + { + "internalType": "address", + "name": "_origin", + "type": "address" + } + ], + "name": "buildWithCast", + "outputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "accountVersion", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_newCheck", + "type": "address" + } + ], + "name": "changeCheck", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newMaster", + "type": "address" + } + ], + "name": "changeMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "check", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "connectors", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "version", + "type": "uint256" + }, + { + "internalType": "address", + "name": "query", + "type": "address" + } + ], + "name": "isClone", + "outputs": [ + { + "internalType": "bool", + "name": "result", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "list", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "master", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_master", + "type": "address" + }, + { + "internalType": "address", + "name": "_list", + "type": "address" + }, + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "address", + "name": "_connectors", + "type": "address" + } + ], + "name": "setBasics", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateMaster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "versionCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50611199806100206000396000f3fe6080604052600436106100dd5760003560e01c80638aad29e11161007f578063cf1a0ddc11610059578063cf1a0ddc14610231578063ee97f7f314610246578063f4ff78bf1461025b578063fdc3870c1461027b576100dd565b80638aad29e1146101cf578063a4bb8e7d146101f1578063bb7e70ef14610211576100dd565b8063443ff7b6116100bb578063443ff7b61461014d5780634f5b25611461016f5780635f72f4501461018257806374368189146101a2576100dd565b80630f560cd7146100e257806313ede1a11461010d5780632dd7c6581461012d575b600080fd5b3480156100ee57600080fd5b506100f761029b565b6040516101049190610e9a565b60405180910390f35b34801561011957600080fd5b506100f7610128366004610df6565b6102aa565b34801561013957600080fd5b506100f7610148366004610df6565b6102c5565b34801561015957600080fd5b5061016d610168366004610e26565b6102e0565b005b6100f761017d366004610cd3565b6103a6565b34801561018e57600080fd5b506100f761019d366004610df6565b610454565b3480156101ae57600080fd5b506101c26101bd366004610e26565b61046f565b6040516101049190610fa1565b3480156101db57600080fd5b506101e46104ea565b60405161010491906110fb565b3480156101fd57600080fd5b5061016d61020c366004610c3b565b6104f0565b34801561021d57600080fd5b506100f761022c366004610c92565b610629565b34801561023d57600080fd5b5061016d61077e565b34801561025257600080fd5b506100f7610823565b34801561026757600080fd5b5061016d610276366004610bd4565b610832565b34801561028757600080fd5b5061016d610296366004610bf6565b610926565b6002546001600160a01b031681565b6003602052600090815260409020546001600160a01b031681565b6005602052600090815260409020546001600160a01b031681565b6001546001600160a01b031633146103135760405162461bcd60e51b815260040161030a906110ac565b60405180910390fd5b6000828152600460205260409020546001600160a01b038281169116141561034d5760405162461bcd60e51b815260040161030a90611059565b60008281526004602052604080822080546001600160a01b0319166001600160a01b0385169081179091559051909184917f1d96dda971e33be0980128bbce3f93dfe4859657397e00d2db4d288d2c2bc7889190a35050565b60006103b3888884610629565b905084156104495760405163e0e90acf60e01b81526001600160a01b0382169063e0e90acf9034906103f1908a908a908a908a908a90600401610eae565b6000604051808303818588803b15801561040a57600080fd5b505af115801561041e573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526104479190810190610d6d565b505b979650505050505050565b6004602052600090815260409020546001600160a01b031681565b60008281526005602052604080822054815169363d3d373d3d3d363d7360b01b815260609190911b6bffffffffffffffffffffffff1916600a82018190526e5af43d82803e903d91602b57fd5bf360881b601e830152918101602d8482873c600d810151600d83015114815183511416935050505092915050565b60065481565b6001546001600160a01b031615801561051257506002546001600160a01b0316155b80156105505750600160005260056020527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b546001600160a01b0316155b801561058e5750600160005260036020527fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c546001600160a01b0316155b801561059a5750600654155b6105b65760405162461bcd60e51b815260040161030a90611005565b600180546001600160a01b039586166001600160a01b03199182161782556002805495871695821695909517909455600680549091018082556000908152600560209081526040808320805496891696881696909617909555915481526003909152919091208054919093169116179055565b6000821580159061063c57506006548311155b6106585760405162461bcd60e51b815260040161030a90610fda565b61066183610b00565b60025460405163066ad14f60e21b81529192506001600160a01b0316906319ab453c90610692908490600401610e9a565b600060405180830381600087803b1580156106ac57600080fd5b505af11580156106c0573d6000803e3d6000fd5b5050604051630b7f436d60e31b81526001600160a01b0384169250635bfa1b6891506106f0908790600401610e9a565b600060405180830381600087803b15801561070a57600080fd5b505af115801561071e573d6000803e3d6000fd5b50505050816001600160a01b0316816001600160a01b0316856001600160a01b03167f83435eca805f6256e4aa778ee8b2e8aec7485fa4b643a0fff05b7df6bf6883893360405161076f9190610e9a565b60405180910390a49392505050565b6000546001600160a01b03166107a65760405162461bcd60e51b815260040161030a906110d0565b6000546001600160a01b031633146107d05760405162461bcd60e51b815260040161030a906110ac565b60008054600180546001600160a01b038084166001600160a01b03199283161792839055921683556040519116917f9ac7c65ebc1e9c5f94a0f9daaed02afefea79ae48162d49f30ab33b6e1637a1d91a2565b6001546001600160a01b031681565b6001546001600160a01b0316331461085c5760405162461bcd60e51b815260040161030a906110ac565b6001546001600160a01b038281169116141561088a5760405162461bcd60e51b815260040161030a90611082565b6001600160a01b0381166108b05760405162461bcd60e51b815260040161030a906110d0565b6000546001600160a01b03828116911614156108de5760405162461bcd60e51b815260040161030a90610fac565b600080546001600160a01b0319166001600160a01b038316908117825560405190917ff2a8c544d5befa20af407e43fa5a05305e50163fb8d06fda74206f0dc08b680f91a250565b6001546001600160a01b031633146109505760405162461bcd60e51b815260040161030a906110ac565b6001600160a01b0383166109765760405162461bcd60e51b815260040161030a906110d0565b60068054600101908190556040805163054fd4d560e41b815290516001600160a01b038616916354fd4d50916004808301926020929190829003018186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190610e0e565b14610a165760405162461bcd60e51b815260040161030a9061102e565b600654600090815260056020526040902080546001600160a01b0319166001600160a01b0385811691909117909155821615610a7757600654600090815260036020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03811615610ab157600654600090815260046020526040902080546001600160a01b0319166001600160a01b0383161790555b806001600160a01b0316826001600160a01b0316846001600160a01b03167ff2ac7d6a10d2f0b9b7fdad229bb1456de7a254de96bb7f55f3d22a91ea93f27f60405160405180910390a4505050565b600081815260056020526040808220549051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b815260609190911b6bffffffffffffffffffffffff1916601482018190526e5af43d82803e903d91602b57fd5bf360881b60288301529060378184f0949350505050565b80356001600160a01b0381168114610b8557600080fd5b92915050565b60008083601f840112610b9c578182fd5b50813567ffffffffffffffff811115610bb3578182fd5b6020830191508360208083028501011115610bcd57600080fd5b9250929050565b600060208284031215610be5578081fd5b610bef8383610b6e565b9392505050565b600080600060608486031215610c0a578182fd5b610c148585610b6e565b9250610c238560208601610b6e565b9150610c328560408601610b6e565b90509250925092565b60008060008060808587031215610c50578081fd5b610c5a8686610b6e565b9350610c698660208701610b6e565b9250610c788660408701610b6e565b9150610c878660608701610b6e565b905092959194509250565b600080600060608486031215610ca6578283fd5b8335610cb18161114b565b9250602084013591506040840135610cc88161114b565b809150509250925092565b600080600080600080600060a0888a031215610ced578283fd5b610cf78989610b6e565b965060208801359550604088013567ffffffffffffffff80821115610d1a578485fd5b610d268b838c01610b8b565b909750955060608a0135915080821115610d3e578485fd5b50610d4b8a828b01610b8b565b9094509250610d5f90508960808a01610b6e565b905092959891949750929550565b60006020808385031215610d7f578182fd5b825167ffffffffffffffff811115610d95578283fd5b8301601f81018513610da5578283fd5b8051610db8610db38261112b565b611104565b8181528381019083850185840285018601891015610dd4578687fd5b8694505b83851015610447578051835260019490940193918501918501610dd8565b600060208284031215610e07578081fd5b5035919050565b600060208284031215610e1f578081fd5b5051919050565b60008060408385031215610e38578182fd5b82359150610e498460208501610b6e565b90509250929050565b6001600160a01b0316815260200190565b6001600160a01b03169052565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6001600160a01b0391909116815260200190565b6000606082016060835280610ec388836110fb565b9050889150825b88811015610ef65760208301610ee983610ee48387610b6e565b610e52565b9093509150600101610eca565b5060209150838103828501528086825282820190508283880283010188855b89811015610f8157848303601f190184528135368c9003601e19018112610f3a578788fd5b8b01803567ffffffffffffffff811115610f52578889fd5b8036038d1315610f60578889fd5b610f6d85828a8501610e70565b958801959450505090850190600101610f15565b505080945050505050610f976040830184610e63565b9695505050505050565b901515815260200190565b60208082526014908201527330b63932b0b23c96b096b732bb96b6b0b9ba32b960611b604082015260600190565b6020808252601190820152701b9bdd0b5d985b1a590b5858d8dbdd5b9d607a1b604082015260600190565b6020808252600f908201526e185b1c9958591e4b5919599a5b9959608a1b604082015260600190565b6020808252601190820152703737ba16bb30b634b216bb32b939b4b7b760791b604082015260600190565b6020808252600f908201526e616c72656164792d612d636865636b60881b604082015260600190565b60208082526010908201526f30b63932b0b23c96b096b6b0b9ba32b960811b604082015260600190565b6020808252600a90820152693737ba16b6b0b9ba32b960b11b604082015260600190565b6020808252601190820152706e6f742d76616c69642d6164647265737360781b604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561112357600080fd5b604052919050565b600067ffffffffffffffff821115611141578081fd5b5060209081020190565b6001600160a01b038116811461116057600080fd5b5056fea2646970667358221220c6c21de8e27c9c328ebc2c96f1f0868657a1e4b5fd0232a7b22dd50874ddca5a64736f6c634300060c0033", + "deployedBytecode": "0x6080604052600436106100dd5760003560e01c80638aad29e11161007f578063cf1a0ddc11610059578063cf1a0ddc14610231578063ee97f7f314610246578063f4ff78bf1461025b578063fdc3870c1461027b576100dd565b80638aad29e1146101cf578063a4bb8e7d146101f1578063bb7e70ef14610211576100dd565b8063443ff7b6116100bb578063443ff7b61461014d5780634f5b25611461016f5780635f72f4501461018257806374368189146101a2576100dd565b80630f560cd7146100e257806313ede1a11461010d5780632dd7c6581461012d575b600080fd5b3480156100ee57600080fd5b506100f761029b565b6040516101049190610e9a565b60405180910390f35b34801561011957600080fd5b506100f7610128366004610df6565b6102aa565b34801561013957600080fd5b506100f7610148366004610df6565b6102c5565b34801561015957600080fd5b5061016d610168366004610e26565b6102e0565b005b6100f761017d366004610cd3565b6103a6565b34801561018e57600080fd5b506100f761019d366004610df6565b610454565b3480156101ae57600080fd5b506101c26101bd366004610e26565b61046f565b6040516101049190610fa1565b3480156101db57600080fd5b506101e46104ea565b60405161010491906110fb565b3480156101fd57600080fd5b5061016d61020c366004610c3b565b6104f0565b34801561021d57600080fd5b506100f761022c366004610c92565b610629565b34801561023d57600080fd5b5061016d61077e565b34801561025257600080fd5b506100f7610823565b34801561026757600080fd5b5061016d610276366004610bd4565b610832565b34801561028757600080fd5b5061016d610296366004610bf6565b610926565b6002546001600160a01b031681565b6003602052600090815260409020546001600160a01b031681565b6005602052600090815260409020546001600160a01b031681565b6001546001600160a01b031633146103135760405162461bcd60e51b815260040161030a906110ac565b60405180910390fd5b6000828152600460205260409020546001600160a01b038281169116141561034d5760405162461bcd60e51b815260040161030a90611059565b60008281526004602052604080822080546001600160a01b0319166001600160a01b0385169081179091559051909184917f1d96dda971e33be0980128bbce3f93dfe4859657397e00d2db4d288d2c2bc7889190a35050565b60006103b3888884610629565b905084156104495760405163e0e90acf60e01b81526001600160a01b0382169063e0e90acf9034906103f1908a908a908a908a908a90600401610eae565b6000604051808303818588803b15801561040a57600080fd5b505af115801561041e573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526104479190810190610d6d565b505b979650505050505050565b6004602052600090815260409020546001600160a01b031681565b60008281526005602052604080822054815169363d3d373d3d3d363d7360b01b815260609190911b6bffffffffffffffffffffffff1916600a82018190526e5af43d82803e903d91602b57fd5bf360881b601e830152918101602d8482873c600d810151600d83015114815183511416935050505092915050565b60065481565b6001546001600160a01b031615801561051257506002546001600160a01b0316155b80156105505750600160005260056020527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b546001600160a01b0316155b801561058e5750600160005260036020527fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c546001600160a01b0316155b801561059a5750600654155b6105b65760405162461bcd60e51b815260040161030a90611005565b600180546001600160a01b039586166001600160a01b03199182161782556002805495871695821695909517909455600680549091018082556000908152600560209081526040808320805496891696881696909617909555915481526003909152919091208054919093169116179055565b6000821580159061063c57506006548311155b6106585760405162461bcd60e51b815260040161030a90610fda565b61066183610b00565b60025460405163066ad14f60e21b81529192506001600160a01b0316906319ab453c90610692908490600401610e9a565b600060405180830381600087803b1580156106ac57600080fd5b505af11580156106c0573d6000803e3d6000fd5b5050604051630b7f436d60e31b81526001600160a01b0384169250635bfa1b6891506106f0908790600401610e9a565b600060405180830381600087803b15801561070a57600080fd5b505af115801561071e573d6000803e3d6000fd5b50505050816001600160a01b0316816001600160a01b0316856001600160a01b03167f83435eca805f6256e4aa778ee8b2e8aec7485fa4b643a0fff05b7df6bf6883893360405161076f9190610e9a565b60405180910390a49392505050565b6000546001600160a01b03166107a65760405162461bcd60e51b815260040161030a906110d0565b6000546001600160a01b031633146107d05760405162461bcd60e51b815260040161030a906110ac565b60008054600180546001600160a01b038084166001600160a01b03199283161792839055921683556040519116917f9ac7c65ebc1e9c5f94a0f9daaed02afefea79ae48162d49f30ab33b6e1637a1d91a2565b6001546001600160a01b031681565b6001546001600160a01b0316331461085c5760405162461bcd60e51b815260040161030a906110ac565b6001546001600160a01b038281169116141561088a5760405162461bcd60e51b815260040161030a90611082565b6001600160a01b0381166108b05760405162461bcd60e51b815260040161030a906110d0565b6000546001600160a01b03828116911614156108de5760405162461bcd60e51b815260040161030a90610fac565b600080546001600160a01b0319166001600160a01b038316908117825560405190917ff2a8c544d5befa20af407e43fa5a05305e50163fb8d06fda74206f0dc08b680f91a250565b6001546001600160a01b031633146109505760405162461bcd60e51b815260040161030a906110ac565b6001600160a01b0383166109765760405162461bcd60e51b815260040161030a906110d0565b60068054600101908190556040805163054fd4d560e41b815290516001600160a01b038616916354fd4d50916004808301926020929190829003018186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190610e0e565b14610a165760405162461bcd60e51b815260040161030a9061102e565b600654600090815260056020526040902080546001600160a01b0319166001600160a01b0385811691909117909155821615610a7757600654600090815260036020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03811615610ab157600654600090815260046020526040902080546001600160a01b0319166001600160a01b0383161790555b806001600160a01b0316826001600160a01b0316846001600160a01b03167ff2ac7d6a10d2f0b9b7fdad229bb1456de7a254de96bb7f55f3d22a91ea93f27f60405160405180910390a4505050565b600081815260056020526040808220549051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b815260609190911b6bffffffffffffffffffffffff1916601482018190526e5af43d82803e903d91602b57fd5bf360881b60288301529060378184f0949350505050565b80356001600160a01b0381168114610b8557600080fd5b92915050565b60008083601f840112610b9c578182fd5b50813567ffffffffffffffff811115610bb3578182fd5b6020830191508360208083028501011115610bcd57600080fd5b9250929050565b600060208284031215610be5578081fd5b610bef8383610b6e565b9392505050565b600080600060608486031215610c0a578182fd5b610c148585610b6e565b9250610c238560208601610b6e565b9150610c328560408601610b6e565b90509250925092565b60008060008060808587031215610c50578081fd5b610c5a8686610b6e565b9350610c698660208701610b6e565b9250610c788660408701610b6e565b9150610c878660608701610b6e565b905092959194509250565b600080600060608486031215610ca6578283fd5b8335610cb18161114b565b9250602084013591506040840135610cc88161114b565b809150509250925092565b600080600080600080600060a0888a031215610ced578283fd5b610cf78989610b6e565b965060208801359550604088013567ffffffffffffffff80821115610d1a578485fd5b610d268b838c01610b8b565b909750955060608a0135915080821115610d3e578485fd5b50610d4b8a828b01610b8b565b9094509250610d5f90508960808a01610b6e565b905092959891949750929550565b60006020808385031215610d7f578182fd5b825167ffffffffffffffff811115610d95578283fd5b8301601f81018513610da5578283fd5b8051610db8610db38261112b565b611104565b8181528381019083850185840285018601891015610dd4578687fd5b8694505b83851015610447578051835260019490940193918501918501610dd8565b600060208284031215610e07578081fd5b5035919050565b600060208284031215610e1f578081fd5b5051919050565b60008060408385031215610e38578182fd5b82359150610e498460208501610b6e565b90509250929050565b6001600160a01b0316815260200190565b6001600160a01b03169052565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b6001600160a01b0391909116815260200190565b6000606082016060835280610ec388836110fb565b9050889150825b88811015610ef65760208301610ee983610ee48387610b6e565b610e52565b9093509150600101610eca565b5060209150838103828501528086825282820190508283880283010188855b89811015610f8157848303601f190184528135368c9003601e19018112610f3a578788fd5b8b01803567ffffffffffffffff811115610f52578889fd5b8036038d1315610f60578889fd5b610f6d85828a8501610e70565b958801959450505090850190600101610f15565b505080945050505050610f976040830184610e63565b9695505050505050565b901515815260200190565b60208082526014908201527330b63932b0b23c96b096b732bb96b6b0b9ba32b960611b604082015260600190565b6020808252601190820152701b9bdd0b5d985b1a590b5858d8dbdd5b9d607a1b604082015260600190565b6020808252600f908201526e185b1c9958591e4b5919599a5b9959608a1b604082015260600190565b6020808252601190820152703737ba16bb30b634b216bb32b939b4b7b760791b604082015260600190565b6020808252600f908201526e616c72656164792d612d636865636b60881b604082015260600190565b60208082526010908201526f30b63932b0b23c96b096b6b0b9ba32b960811b604082015260600190565b6020808252600a90820152693737ba16b6b0b9ba32b960b11b604082015260600190565b6020808252601190820152706e6f742d76616c69642d6164647265737360781b604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561112357600080fd5b604052919050565b600067ffffffffffffffff821115611141578081fd5b5060209081020190565b6001600160a01b038116811461116057600080fd5b5056fea2646970667358221220c6c21de8e27c9c328ebc2c96f1f0868657a1e4b5fd0232a7b22dd50874ddca5a64736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/pre-compiles/InstaList.json b/pre-compiles/InstaList.json new file mode 100644 index 0000000..1e6cf22 --- /dev/null +++ b/pre-compiles/InstaList.json @@ -0,0 +1,228 @@ +{ + "contractName": "InstaList", + "abi": [ + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "accountAddr", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "accountID", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "accountLink", + "outputs": [ + { + "internalType": "address", + "name": "first", + "type": "address" + }, + { + "internalType": "address", + "name": "last", + "type": "address" + }, + { + "internalType": "uint64", + "name": "count", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "accountList", + "outputs": [ + { + "internalType": "address", + "name": "prev", + "type": "address" + }, + { + "internalType": "address", + "name": "next", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "accounts", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "addAuth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "init", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "instaIndex", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "removeAuth", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userLink", + "outputs": [ + { + "internalType": "uint64", + "name": "first", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "last", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "count", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "name": "userList", + "outputs": [ + { + "internalType": "uint64", + "name": "prev", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "next", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b50610fb4806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80636cfaf5e9116100715780636cfaf5e9146101c6578063748e6e18146101ec5780637f3fd918146102505780638028a9fd14610276578063a41098bf146102cf578063f227a99f146102d7576100a9565b806319ab453c146100ae5780635422224e146100d65780635f3c37f9146100fc57806360330d791461016057806368cd03f6146101a2575b600080fd5b6100d4600480360360208110156100c457600080fd5b50356001600160a01b0316610328565b005b6100d4600480360360208110156100ec57600080fd5b50356001600160a01b03166103d6565b6101316004803603604081101561011257600080fd5b5080356001600160401b031690602001356001600160a01b0316610528565b60405180836001600160a01b03168152602001826001600160a01b031681526020019250505060405180910390f35b6101866004803603602081101561017657600080fd5b50356001600160401b0316610559565b604080516001600160a01b039092168252519081900360200190f35b6101aa610574565b604080516001600160401b039092168252519081900360200190f35b6101aa600480360360208110156101dc57600080fd5b50356001600160a01b0316610583565b6102216004803603604081101561020257600080fd5b5080356001600160a01b031690602001356001600160401b031661059e565b60405180836001600160401b03168152602001826001600160401b031681526020019250505060405180910390f35b6100d46004803603602081101561026657600080fd5b50356001600160a01b03166105cf565b61029c6004803603602081101561028c57600080fd5b50356001600160401b0316610723565b604080516001600160a01b0394851681529290931660208301526001600160401b03168183015290519081900360600190f35b61018661075b565b6102fd600480360360208110156102ed57600080fd5b50356001600160a01b0316610760565b604080516001600160401b039485168152928416602084015292168183015290519081900360600190f35b3315610367576040805162461bcd60e51b81526020600482015260096024820152680dcdee85ad2dcc8caf60bb1b604482015290519081900360640190fd5b600080546001600160401b038082166001908101821667ffffffffffffffff19938416178085556001600160a01b0390951680855260209182526040808620805490951696841696909617909355835490911683526002905291902080546001600160a01b0319169091179055565b336000908152600160205260409020546001600160401b031661042e576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd0b5858d8dbdd5b9d60aa1b604482015290519081900360640190fd5b60408051632520e7ff60e01b81526001600160a01b038316600482015290513391632520e7ff916024808301926020929190829003018186803b15801561047457600080fd5b505afa158015610488573d6000803e3d6000fd5b505050506040513d602081101561049e57600080fd5b50516104dd576040805162461bcd60e51b81526020600482015260096024820152683737ba16b7bbb732b960b91b604482015290519081900360640190fd5b336000908152600160205260409020546105019082906001600160401b0316610791565b336000908152600160205260409020546105259082906001600160401b031661092f565b50565b6006602090815260009283526040808420909152908252902080546001909101546001600160a01b03918216911682565b6002602052600090815260409020546001600160a01b031681565b6000546001600160401b031681565b6001602052600090815260409020546001600160401b031681565b60046020908152600092835260408084209091529082529020546001600160401b0380821691600160401b90041682565b336000908152600160205260409020546001600160401b0316610627576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd0b5858d8dbdd5b9d60aa1b604482015290519081900360640190fd5b60408051632520e7ff60e01b81526001600160a01b038316600482015290513391632520e7ff916024808301926020929190829003018186803b15801561066d57600080fd5b505afa158015610681573d6000803e3d6000fd5b505050506040513d602081101561069757600080fd5b5051156106db576040805162461bcd60e51b815260206004820152600d60248201526c30b63932b0b23c96b7bbb732b960991b604482015290519081900360640190fd5b336000908152600160205260409020546106ff9082906001600160401b0316610aa6565b336000908152600160205260409020546105259082906001600160401b0316610cb6565b600560205260009081526040902080546001909101546001600160a01b0391821691811690600160a01b90046001600160401b031683565b600081565b6003602052600090815260409020546001600160401b0380821691600160401b8104821691600160801b9091041683565b6001600160a01b038216600090815260036020526040902054600160401b90046001600160401b031615610839576001600160a01b03821660009081526003602090815260408083208054600484528285206001600160401b03878116808852919095528386208054600160401b93849004871667ffffffffffffffff19909116179055915481900490931684529220805467ffffffffffffffff60401b1916919092021790555b6001600160a01b0382166000908152600360205260409020546001600160401b0316610892576001600160a01b0382166000908152600360205260409020805467ffffffffffffffff19166001600160401b0383161790555b6001600160a01b038216600090815260036020526040902080546001600160401b03808416600160401b0267ffffffffffffffff60401b1990921691909117918290556108e891600160801b9004166001610ec1565b6001600160a01b03909216600090815260036020526040902080546001600160401b0393909316600160801b0267ffffffffffffffff60801b199093169290921790915550565b6001600160401b0381166000908152600560205260409020600101546001600160a01b0316156109c4576001600160401b038116600090815260056020908152604080832060019081018054600685528386206001600160a01b038981168089529190965284872080549287166001600160a01b03199384161790559154909416855291909320909201805490911690911790555b6001600160401b0381166000908152600560205260409020546001600160a01b0316610a1c576001600160401b038116600090815260056020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160401b038181166000908152600560205260409020600190810180546001600160a01b0319166001600160a01b0386161790819055610a6892600160a01b9091041690610ec1565b6001600160401b039182166000908152600560205260409020600101805491909216600160a01b0267ffffffffffffffff60a01b1990911617905550565b6001600160a01b03821660009081526004602090815260408083206001600160401b03858116855292529091205480821691600160401b909104168115610b36576001600160a01b03841660009081526004602090815260408083206001600160401b03808716855292529091208054918316600160401b0267ffffffffffffffff60401b199092169190911790555b6001600160401b03811615610b89576001600160a01b03841660009081526004602090815260408083206001600160401b0385811685529252909120805467ffffffffffffffff19169184169190911790555b6001600160401b038216610bca576001600160a01b0384166000908152600360205260409020805467ffffffffffffffff19166001600160401b0383161790555b6001600160401b038116610c14576001600160a01b0384166000908152600360205260409020805467ffffffffffffffff60401b1916600160401b6001600160401b038516021790555b6001600160a01b038416600090815260036020526040902054610c4890600160801b90046001600160401b03166001610f22565b6001600160a01b03949094166000908152600360209081526040808320805467ffffffffffffffff60801b1916600160801b6001600160401b03998a1602179055600482528083209590961682529390935250502080546fffffffffffffffffffffffffffffffff19169055565b6001600160401b03811660009081526006602090815260408083206001600160a01b0386811685529252909120805460019091015490821691168115610d3c576001600160401b03831660009081526006602090815260408083206001600160a01b038681168552925290912060010180546001600160a01b0319169183169190911790555b6001600160a01b03811615610d8e576001600160401b03831660009081526006602090815260408083206001600160a01b038581168552925290912080546001600160a01b0319169184169190911790555b6001600160a01b038216610dce576001600160401b038316600090815260056020526040902080546001600160a01b0319166001600160a01b0383161790555b6001600160a01b038116610e11576001600160401b038316600090815260056020526040902060010180546001600160a01b0319166001600160a01b0384161790555b6001600160401b038084166000908152600560205260409020600190810154610e4392600160a01b9091041690610f22565b6001600160401b0393841660009081526005602090815260408083206001908101805495909816600160a01b0267ffffffffffffffff60a01b1990951694909417909655600681528582206001600160a01b039097168252959095529290932080546001600160a01b03199081168255920180549092169091555050565b8082016001600160401b038084169082161015610f1c576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b92915050565b8082036001600160401b038084169082161115610f1c576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fdfea2646970667358221220c45a7c96b07471f5af32f4cbf3c5195da4d38431308fbcb1d062df1b6c2465d964736f6c634300060c0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80636cfaf5e9116100715780636cfaf5e9146101c6578063748e6e18146101ec5780637f3fd918146102505780638028a9fd14610276578063a41098bf146102cf578063f227a99f146102d7576100a9565b806319ab453c146100ae5780635422224e146100d65780635f3c37f9146100fc57806360330d791461016057806368cd03f6146101a2575b600080fd5b6100d4600480360360208110156100c457600080fd5b50356001600160a01b0316610328565b005b6100d4600480360360208110156100ec57600080fd5b50356001600160a01b03166103d6565b6101316004803603604081101561011257600080fd5b5080356001600160401b031690602001356001600160a01b0316610528565b60405180836001600160a01b03168152602001826001600160a01b031681526020019250505060405180910390f35b6101866004803603602081101561017657600080fd5b50356001600160401b0316610559565b604080516001600160a01b039092168252519081900360200190f35b6101aa610574565b604080516001600160401b039092168252519081900360200190f35b6101aa600480360360208110156101dc57600080fd5b50356001600160a01b0316610583565b6102216004803603604081101561020257600080fd5b5080356001600160a01b031690602001356001600160401b031661059e565b60405180836001600160401b03168152602001826001600160401b031681526020019250505060405180910390f35b6100d46004803603602081101561026657600080fd5b50356001600160a01b03166105cf565b61029c6004803603602081101561028c57600080fd5b50356001600160401b0316610723565b604080516001600160a01b0394851681529290931660208301526001600160401b03168183015290519081900360600190f35b61018661075b565b6102fd600480360360208110156102ed57600080fd5b50356001600160a01b0316610760565b604080516001600160401b039485168152928416602084015292168183015290519081900360600190f35b3315610367576040805162461bcd60e51b81526020600482015260096024820152680dcdee85ad2dcc8caf60bb1b604482015290519081900360640190fd5b600080546001600160401b038082166001908101821667ffffffffffffffff19938416178085556001600160a01b0390951680855260209182526040808620805490951696841696909617909355835490911683526002905291902080546001600160a01b0319169091179055565b336000908152600160205260409020546001600160401b031661042e576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd0b5858d8dbdd5b9d60aa1b604482015290519081900360640190fd5b60408051632520e7ff60e01b81526001600160a01b038316600482015290513391632520e7ff916024808301926020929190829003018186803b15801561047457600080fd5b505afa158015610488573d6000803e3d6000fd5b505050506040513d602081101561049e57600080fd5b50516104dd576040805162461bcd60e51b81526020600482015260096024820152683737ba16b7bbb732b960b91b604482015290519081900360640190fd5b336000908152600160205260409020546105019082906001600160401b0316610791565b336000908152600160205260409020546105259082906001600160401b031661092f565b50565b6006602090815260009283526040808420909152908252902080546001909101546001600160a01b03918216911682565b6002602052600090815260409020546001600160a01b031681565b6000546001600160401b031681565b6001602052600090815260409020546001600160401b031681565b60046020908152600092835260408084209091529082529020546001600160401b0380821691600160401b90041682565b336000908152600160205260409020546001600160401b0316610627576040805162461bcd60e51b815260206004820152600b60248201526a1b9bdd0b5858d8dbdd5b9d60aa1b604482015290519081900360640190fd5b60408051632520e7ff60e01b81526001600160a01b038316600482015290513391632520e7ff916024808301926020929190829003018186803b15801561066d57600080fd5b505afa158015610681573d6000803e3d6000fd5b505050506040513d602081101561069757600080fd5b5051156106db576040805162461bcd60e51b815260206004820152600d60248201526c30b63932b0b23c96b7bbb732b960991b604482015290519081900360640190fd5b336000908152600160205260409020546106ff9082906001600160401b0316610aa6565b336000908152600160205260409020546105259082906001600160401b0316610cb6565b600560205260009081526040902080546001909101546001600160a01b0391821691811690600160a01b90046001600160401b031683565b600081565b6003602052600090815260409020546001600160401b0380821691600160401b8104821691600160801b9091041683565b6001600160a01b038216600090815260036020526040902054600160401b90046001600160401b031615610839576001600160a01b03821660009081526003602090815260408083208054600484528285206001600160401b03878116808852919095528386208054600160401b93849004871667ffffffffffffffff19909116179055915481900490931684529220805467ffffffffffffffff60401b1916919092021790555b6001600160a01b0382166000908152600360205260409020546001600160401b0316610892576001600160a01b0382166000908152600360205260409020805467ffffffffffffffff19166001600160401b0383161790555b6001600160a01b038216600090815260036020526040902080546001600160401b03808416600160401b0267ffffffffffffffff60401b1990921691909117918290556108e891600160801b9004166001610ec1565b6001600160a01b03909216600090815260036020526040902080546001600160401b0393909316600160801b0267ffffffffffffffff60801b199093169290921790915550565b6001600160401b0381166000908152600560205260409020600101546001600160a01b0316156109c4576001600160401b038116600090815260056020908152604080832060019081018054600685528386206001600160a01b038981168089529190965284872080549287166001600160a01b03199384161790559154909416855291909320909201805490911690911790555b6001600160401b0381166000908152600560205260409020546001600160a01b0316610a1c576001600160401b038116600090815260056020526040902080546001600160a01b0319166001600160a01b0384161790555b6001600160401b038181166000908152600560205260409020600190810180546001600160a01b0319166001600160a01b0386161790819055610a6892600160a01b9091041690610ec1565b6001600160401b039182166000908152600560205260409020600101805491909216600160a01b0267ffffffffffffffff60a01b1990911617905550565b6001600160a01b03821660009081526004602090815260408083206001600160401b03858116855292529091205480821691600160401b909104168115610b36576001600160a01b03841660009081526004602090815260408083206001600160401b03808716855292529091208054918316600160401b0267ffffffffffffffff60401b199092169190911790555b6001600160401b03811615610b89576001600160a01b03841660009081526004602090815260408083206001600160401b0385811685529252909120805467ffffffffffffffff19169184169190911790555b6001600160401b038216610bca576001600160a01b0384166000908152600360205260409020805467ffffffffffffffff19166001600160401b0383161790555b6001600160401b038116610c14576001600160a01b0384166000908152600360205260409020805467ffffffffffffffff60401b1916600160401b6001600160401b038516021790555b6001600160a01b038416600090815260036020526040902054610c4890600160801b90046001600160401b03166001610f22565b6001600160a01b03949094166000908152600360209081526040808320805467ffffffffffffffff60801b1916600160801b6001600160401b03998a1602179055600482528083209590961682529390935250502080546fffffffffffffffffffffffffffffffff19169055565b6001600160401b03811660009081526006602090815260408083206001600160a01b0386811685529252909120805460019091015490821691168115610d3c576001600160401b03831660009081526006602090815260408083206001600160a01b038681168552925290912060010180546001600160a01b0319169183169190911790555b6001600160a01b03811615610d8e576001600160401b03831660009081526006602090815260408083206001600160a01b038581168552925290912080546001600160a01b0319169184169190911790555b6001600160a01b038216610dce576001600160401b038316600090815260056020526040902080546001600160a01b0319166001600160a01b0383161790555b6001600160a01b038116610e11576001600160401b038316600090815260056020526040902060010180546001600160a01b0319166001600160a01b0384161790555b6001600160401b038084166000908152600560205260409020600190810154610e4392600160a01b9091041690610f22565b6001600160401b0393841660009081526005602090815260408083206001908101805495909816600160a01b0267ffffffffffffffff60a01b1990951694909417909655600681528582206001600160a01b039097168252959095529290932080546001600160a01b03199081168255920180549092169091555050565b8082016001600160401b038084169082161015610f1c576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b92915050565b8082036001600160401b038084169082161115610f1c576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fdfea2646970667358221220c45a7c96b07471f5af32f4cbf3c5195da4d38431308fbcb1d062df1b6c2465d964736f6c634300060c0033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/rinkeby-test/0-1-tx-onboarding.js b/rinkeby-test/0-1-tx-onboarding.js new file mode 100644 index 0000000..a4c204f --- /dev/null +++ b/rinkeby-test/0-1-tx-onboarding.js @@ -0,0 +1,389 @@ +// We require the Buidler Runtime Environment explicitly here. This is optional +// but useful for running the script in a standalone fashion through `node