From 4132c595047369642739f3fd54b10953397206d7 Mon Sep 17 00:00:00 2001 From: John Whitton Date: Mon, 19 Sep 2022 14:34:33 -0700 Subject: [PATCH 01/12] Fixes to ensure miniwallet and miniserver can be validated against ethlocal --- miniserver/.env.example | 2 +- miniserver/abi/MiniWallet.json | 2101 +++++++++++++------------- miniserver/blockchain.js | 2 + miniserver/routes/index.js | 10 +- miniwallet/.env.example | 10 +- miniwallet/config.test.ts | 2 +- miniwallet/config.ts | 10 +- miniwallet/devlog/FEATURE_ROLLOUT.md | 11 +- miniwallet/hardhat.config.ts | 2 +- server/yarn.lock | 378 ----- 10 files changed, 1085 insertions(+), 1443 deletions(-) diff --git a/miniserver/.env.example b/miniserver/.env.example index b8d9bfc..9a99841 100644 --- a/miniserver/.env.example +++ b/miniserver/.env.example @@ -46,7 +46,7 @@ POLLING_INTERVAL=1000 DEFAULT_NETWORK='eth-local' GAS_LIMIT='67219000' #GAS_PRICE='10000000' -GAS_PRICE='413290302' +GAS_PRICE='529942254' CACHE='cache' STATS_PATH='../data/stats.json' OTP_INTERVAL=60000 diff --git a/miniserver/abi/MiniWallet.json b/miniserver/abi/MiniWallet.json index 05dd163..ad7abba 100644 --- a/miniserver/abi/MiniWallet.json +++ b/miniserver/abi/MiniWallet.json @@ -1,1046 +1,1055 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "allowance", - "type": "uint256" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "SendFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "enum Enums.TokenType", - "name": "tokenType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "WithdrawalFailed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "allowance", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "name": "DepositSuccessful", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newGlobalUserAuthLimit", - "type": "uint256" - } - ], - "name": "GlobalUserAuthLimitChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newGlobalUserLimit", - "type": "uint256" - } - ], - "name": "GlobalUserLimitChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newThreshold", - "type": "uint256" - } - ], - "name": "OperatorThresholdChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "operators", - "type": "address[]" - } - ], - "name": "OperatorsAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "operators", - "type": "address[]" - } - ], - "name": "OperatorsRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "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": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newAllowance", - "type": "uint256" - } - ], - "name": "SendSuccessful", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "enum Enums.TokenType", - "name": "tokenType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "TransferSuccessful", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "name": "WithdrawalSuccessful", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "operatorAddresses", - "type": "address[]" - } - ], - "name": "adminAddOperators", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGlobalUserAuthLimit", - "type": "uint256" - } - ], - "name": "adminChangeGlobalUserAuthLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGlobalUserLimit", - "type": "uint256" - } - ], - "name": "adminChangeGlobalUserLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newThreshold", - "type": "uint256" - } - ], - "name": "adminChangeOperatorThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "adminPauseMiniWallet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "operatorAddresses", - "type": "address[]" - } - ], - "name": "adminRemoveOperators", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "adminUnpauseMiniWallet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "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": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "globalUserAuthLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "globalUserLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "initialOperatorThreshold", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "initialOperators", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "globalUserLimit_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "globalUserAuthLimit_", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "operatorThreshold", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "renounceAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "send", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "enum Enums.TokenType", - "name": "tokenType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -], \ No newline at end of file +{ + "_format": "hh-sol-artifact-1", + "contractName": "MiniWallet", + "sourceName": "contracts/miniWallet/MiniWallet.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "SendFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "enum Enums.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "WithdrawalFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "DepositSuccessful", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newGlobalUserAuthLimit", + "type": "uint256" + } + ], + "name": "GlobalUserAuthLimitChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newGlobalUserLimit", + "type": "uint256" + } + ], + "name": "GlobalUserLimitChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newThreshold", + "type": "uint256" + } + ], + "name": "OperatorThresholdChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "operators", + "type": "address[]" + } + ], + "name": "OperatorsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "operators", + "type": "address[]" + } + ], + "name": "OperatorsRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "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": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newAllowance", + "type": "uint256" + } + ], + "name": "SendSuccessful", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum Enums.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "TransferSuccessful", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "WithdrawalSuccessful", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OPERATOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "operatorAddresses", + "type": "address[]" + } + ], + "name": "adminAddOperators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newGlobalUserAuthLimit", + "type": "uint256" + } + ], + "name": "adminChangeGlobalUserAuthLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newGlobalUserLimit", + "type": "uint256" + } + ], + "name": "adminChangeGlobalUserLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newThreshold", + "type": "uint256" + } + ], + "name": "adminChangeOperatorThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "adminPauseMiniWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "operatorAddresses", + "type": "address[]" + } + ], + "name": "adminRemoveOperators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "adminUnpauseMiniWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "globalUserAuthLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "globalUserLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "initialOperatorThreshold", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "initialOperators", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "globalUserLimit_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "globalUserAuthLimit_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "operatorThreshold", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "renounceAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "send", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "enum Enums.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60a06040523060805234801561001457600080fd5b50608051612da161004c60003960008181610d7f01528181610dbf015281816111460152818161118601526112150152612da16000f3fe6080604052600436106101f95760003560e01c80635e1fab0f1161010d578063bcca7b1d116100a0578063dd62ed3e1161006f578063dd62ed3e1461058a578063e24814d6146105d1578063e2b0df8f146105fe578063f5b541a614610615578063f72c0d8b1461063757600080fd5b8063bcca7b1d14610522578063ca15c87314610542578063d0e30db014610562578063d547741f1461056a57600080fd5b806391d14854116100dc57806391d14854146104ad578063a19ba036146104cd578063a217fddf146104ed578063b4d89a071461050257600080fd5b80635e1fab0f1461042057806378226fe71461044057806379c0fb6e146104555780639010d07c1461047557600080fd5b80632e1a7d4d116101905780633d0594d41161015f5780633d0594d4146103a95780634f1ef286146103c957806352d1902d146103dc578063562c2d1d146103f15780635c975abb1461040857600080fd5b80632e1a7d4d146103295780632f2ff15d1461034957806336568abe146103695780633659cfe61461038957600080fd5b80631322a2a5116101cc5780631322a2a51461027d578063248a9ca31461029d57806326224c64146102db5780632752a46e1461030957600080fd5b806301ffc9a7146101fe5780630227c93614610233578063095ea7b31461024a5780630c8a263c1461025d575b600080fd5b34801561020a57600080fd5b5061021e6102193660046124df565b61066b565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b50610248610696565b005b61021e610258366004612525565b6106d0565b34801561026957600080fd5b5061024861027836600461254f565b61087e565b34801561028957600080fd5b506102486102983660046125b4565b6108fa565b3480156102a957600080fd5b506102cd6102b836600461254f565b60009081526097602052604090206001015490565b60405190815260200161022a565b3480156102e757600080fd5b506102cd6102f63660046125f6565b6101616020526000908152604090205481565b34801561031557600080fd5b506102486103243660046125b4565b610a1c565b34801561033557600080fd5b5061024861034436600461254f565b610b9b565b34801561035557600080fd5b50610248610364366004612611565b610ccc565b34801561037557600080fd5b50610248610384366004612611565b610cf6565b34801561039557600080fd5b506102486103a43660046125f6565b610d74565b3480156103b557600080fd5b506102486103c436600461263d565b610e54565b6102486103d736600461268f565b61113b565b3480156103e857600080fd5b506102cd611208565b3480156103fd57600080fd5b506102cd61015f5481565b34801561041457600080fd5b5060335460ff1661021e565b34801561042c57600080fd5b5061024861043b3660046125f6565b6112bb565b34801561044c57600080fd5b50610248611348565b34801561046157600080fd5b5061024861047036600461254f565b611377565b34801561048157600080fd5b50610495610490366004612751565b6113d4565b6040516001600160a01b03909116815260200161022a565b3480156104b957600080fd5b5061021e6104c8366004612611565b6113f3565b3480156104d957600080fd5b506102486104e836600461254f565b61141e565b3480156104f957600080fd5b506102cd600081565b34801561050e57600080fd5b5061024861051d366004612773565b61147b565b34801561052e57600080fd5b5061024861053d3660046127e0565b611657565b34801561054e57600080fd5b506102cd61055d36600461254f565b611930565b610248611947565b34801561057657600080fd5b50610248610585366004612611565b611a43565b34801561059657600080fd5b506102cd6105a536600461284c565b6001600160a01b0391821660009081526101626020908152604080832093909416825291909152205490565b3480156105dd57600080fd5b50610163546105ec9060ff1681565b60405160ff909116815260200161022a565b34801561060a57600080fd5b506102cd6101605481565b34801561062157600080fd5b506102cd600080516020612d2583398151915281565b34801561064357600080fd5b506102cd7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b60006001600160e01b03198216635a05180f60e01b1480610690575061069082611a68565b92915050565b6106a16000336113f3565b6106c65760405162461bcd60e51b81526004016106bd90612876565b60405180910390fd5b6106ce611a9d565b565b60006106da611af7565b338061073a5760405162461bcd60e51b815260206004820152602960248201527f4d696e6957616c6c65743a20617070726f76652066726f6d20746865207a65726044820152686f206164647265737360b81b60648201526084016106bd565b6001600160a01b0384166107a05760405162461bcd60e51b815260206004820152602760248201527f4d696e6957616c6c65743a20617070726f766520746f20746865207a65726f206044820152666164647265737360c81b60648201526084016106bd565b61015f548311156108095760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a20617070726f76652067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b341561081757610817611947565b6001600160a01b038181166000818152610162602090815260408083209489168084529482529182902087905590518681527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6108896000336113f3565b6108a55760405162461bcd60e51b81526004016106bd90612876565b6108ae81611b3d565b610163805460ff191660ff929092169190911790556040518181527fdd30dc35fb86c568de39420f82e371835e8392fdbf6828c67e685a87f115a910906020015b60405180910390a150565b6109056000336113f3565b6109215760405162461bcd60e51b81526004016106bd90612876565b60005b818110156109de576000838383818110610940576109406128ad565b905060200201602081019061095591906125f6565b905061096f600080516020612d25833981519152826113f3565b6109b35760405162461bcd60e51b81526020600482015260156024820152743932b6b7bb34b733903737b716b7b832b930ba37b960591b60448201526064016106bd565b6109cb600080516020612d2583398151915282611a43565b50806109d6816128d9565b915050610924565b507fd045926746dab8a5acf225487f413b986460165cf50f6052689a2e471198e0598282604051610a109291906128f4565b60405180910390a15050565b610a276000336113f3565b610a435760405162461bcd60e51b81526004016106bd90612876565b60005b81811015610b69576000838383818110610a6257610a626128ad565b9050602002016020810190610a7791906125f6565b9050610a91600080516020612d25833981519152826113f3565b15610ade5760405162461bcd60e51b815260206004820152601960248201527f616c726561647920686173206f70657261746f7220726f6c650000000000000060448201526064016106bd565b6101635460ff16610afc600080516020612d25833981519152611930565b10610b3e5760405162461bcd60e51b8152602060048201526012602482015271746f6f206d616e79206f70657261746f727360701b60448201526064016106bd565b610b56600080516020612d2583398151915282610ccc565b5080610b61816128d9565b915050610a46565b507f4c022f03c292dfa42133bfa9f90bbf55089da679c2df97df205f337c12ab7b7c8282604051610a109291906128f4565b610ba3611af7565b336000908152610161602052604090205481610bbd578091505b80821115610c305760405163993995bb60e01b8152336004820152602481018390526044810182905260806064820152602560848201527f496e73756666696369656e74206c6f636b65642066756e647320746f2077697460a482015264686472617760d81b60c482015260e4016106bd565b6000610c3c8383612940565b336000818152610161602052604080822084905551929350909185156108fc0291869190818181858888f19350505050158015610c7d573d6000803e3d6000fd5b503360008181526101616020908152604091829020548251878152918201527ffb59733a8f0bd43414922fb86c6ffdd090e44935074086318980ca89221acc56910160405180910390a2505050565b600082815260976020526040902060010154610ce781611b94565b610cf18383611b9e565b505050565b6001600160a01b0381163314610d665760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106bd565b610d708282611bc0565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610dbd5760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e06600080516020612d05833981519152546001600160a01b031690565b6001600160a01b031614610e2c5760405162461bcd60e51b81526004016106bd906129a3565b610e3581611be2565b60408051600080825260208201909252610e5191839190611c0c565b50565b610e6c600080516020612d25833981519152336113f3565b610e885760405162461bcd60e51b81526004016106bd906129ef565b610e90611af7565b6001600160a01b0382811660009081526101616020908152604080832054610162835281842094861684529390915290205484610f3d57604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152601a60c48201527f53656e6420616d6f756e742063616e6e6f7420657175616c203000000000000060e4820152610104016106bd565b81851115610fc657604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602160c48201527f496e73756666696369656e74206c6f636b65642066756e647320746f2073656e60e4820152601960fa1b610104820152610124016106bd565b8085111561105157604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602360c48201527f496e73756666696369656e7420617070726f7665642066756e647320746f207360e482015262195b9960ea1b610104820152610124016106bd565b600061105d8684612940565b6001600160a01b0386166000908152610161602052604081208290559091506110868784612940565b6001600160a01b03808816600090815261016260209081526040808320938a168084529390915280822084905551929350909189156108fc02918a9190818181858888f193505050501580156110e0573d6000803e3d6000fd5b5060408051888152602081018490529081018290526001600160a01b0380871691908816907f097db31093a1dfbc4fca0de24d2ea0d787b2de44c5fce71552714981745334e29060600160405180910390a350505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156111845760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111cd600080516020612d05833981519152546001600160a01b031690565b6001600160a01b0316146111f35760405162461bcd60e51b81526004016106bd906129a3565b6111fc82611be2565b610d7082826001611c0c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112a85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106bd565b50600080516020612d0583398151915290565b6112c66000336113f3565b6112e25760405162461bcd60e51b81526004016106bd90612876565b336001600160a01b03821614156113325760405162461bcd60e51b815260206004820152601460248201527331b0b73737ba103932b737bab731b29039b2b63360611b60448201526064016106bd565b61133d600082610ccc565b610e51600033610cf6565b6113536000336113f3565b61136f5760405162461bcd60e51b81526004016106bd90612876565b6106ce611d86565b6113826000336113f3565b61139e5760405162461bcd60e51b81526004016106bd90612876565b61015f8190556040518181527fec0d2c2f3a2fec7d9ce81f6f984ece08f0cdf867116717553c179253c65dca00906020016108ef565b600082815260c9602052604081206113ec9083611dbf565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6114296000336113f3565b6114455760405162461bcd60e51b81526004016106bd90612876565b6101608190556040518181527f0595560a63185cdb6922ec5f6b5279ada789aeea2ab360c554dfc94c0b19cc30906020016108ef565b600054610100900460ff161580801561149b5750600054600160ff909116105b806114b55750303b1580156114b5575060005460ff166001145b6115185760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106bd565b6000805460ff19166001179055801561153b576000805461ff0019166101001790555b337fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610381905561156b600082611dcb565b6115957f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e333611b9e565b610163805460ff191660ff891617905560005b858110156115fb576115e9600080516020612d258339815191528888848181106115d4576115d46128ad565b905060200201602081019061036491906125f6565b806115f3816128d9565b9150506115a8565b505061016083905561015f829055801561164f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61166f600080516020612d25833981519152336113f3565b61168b5760405162461bcd60e51b81526004016106bd906129ef565b611693611af7565b60008560038111156116a7576116a7612a30565b14156117c4576040516323b872dd60e01b81526001600160a01b038381166004830152828116602483015260448201889052600091908516906323b872dd90606401602060405180830381600087803b15801561170357600080fd5b505af1158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173b9190612a46565b9050801561179957816001600160a01b0316836001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db388989898960405161178c9493929190612a8a565b60405180910390a36117be565b8686868686866040516332ee88b960e11b81526004016106bd96959493929190612abe565b5061164f565b60018560038111156117d8576117d8612a30565b141561189f57604051632142170760e11b81526001600160a01b0383811660048301528281166024830152604482018690528416906342842e0e906064015b600060405180830381600087803b15801561183157600080fd5b505af1158015611845573d6000803e3d6000fd5b50505050806001600160a01b0316826001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db38888888886040516118929493929190612a8a565b60405180910390a361164f565b60028560038111156118b3576118b3612a30565b141561190b57604051637921219560e11b81526001600160a01b0383811660048301528281166024830152604482018690526064820188905260a06084830152600060a483015284169063f242432a9060c401611817565b8585858585856040516332ee88b960e11b81526004016106bd96959493929190612b2d565b600081815260c96020526040812061069090611dd5565b61194f611af7565b61016054336000908152610161602052604090205461196f903490612b97565b11156119d35760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a206465706f7369742067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b3360009081526101616020526040812080543492906119f3908490612b97565b90915550503360008181526101616020908152604091829020548251348152918201527f61bb8b82654398e0bdd4e0d489b5e9104b6840211fd89f7264264c96589051fd910160405180910390a2565b600082815260976020526040902060010154611a5e81611b94565b610cf18383611bc0565b60006001600160e01b03198216637965db0b60e01b148061069057506301ffc9a760e01b6001600160e01b0319831614610690565b611aa5611af7565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ada3390565b6040516001600160a01b03909116815260200160405180910390a1565b60335460ff16156106ce5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106bd565b60006101008210611b905760405162461bcd60e51b815260206004820152601c60248201527f76616c756520646f6573206e6f742066697420696e203820626974730000000060448201526064016106bd565b5090565b610e518133611ddf565b611ba88282611e43565b600082815260c960205260409020610cf19082611ec9565b611bca8282611ede565b600082815260c960205260409020610cf19082611f45565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610d7081611b94565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c3f57610cf183611f5a565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7857600080fd5b505afa925050508015611ca8575060408051601f3d908101601f19168201909252611ca591810190612baf565b60015b611d0b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016106bd565b600080516020612d058339815191528114611d7a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016106bd565b50610cf1838383611ff6565b611d8e612021565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611ada565b60006113ec838361206a565b610d708282611b9e565b6000610690825490565b611de982826113f3565b610d7057611e01816001600160a01b03166014612094565b611e0c836020612094565b604051602001611e1d929190612bf4565b60408051601f198184030181529082905262461bcd60e51b82526106bd91600401612c69565b611e4d82826113f3565b610d705760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611e853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113ec836001600160a01b038416612230565b611ee882826113f3565b15610d705760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006113ec836001600160a01b03841661227f565b6001600160a01b0381163b611fc75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016106bd565b600080516020612d0583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611fff83612372565b60008251118061200c5750805b15610cf15761201b83836123b2565b50505050565b60335460ff166106ce5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106bd565b6000826000018281548110612081576120816128ad565b9060005260206000200154905092915050565b606060006120a3836002612c9c565b6120ae906002612b97565b67ffffffffffffffff8111156120c6576120c6612679565b6040519080825280601f01601f1916602001820160405280156120f0576020820181803683370190505b509050600360fc1b8160008151811061210b5761210b6128ad565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061213a5761213a6128ad565b60200101906001600160f81b031916908160001a905350600061215e846002612c9c565b612169906001612b97565b90505b60018111156121e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061219d5761219d6128ad565b1a60f81b8282815181106121b3576121b36128ad565b60200101906001600160f81b031916908160001a90535060049490941c936121da81612cbb565b905061216c565b5083156113ec5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106bd565b600081815260018301602052604081205461227757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610690565b506000610690565b600081815260018301602052604081205480156123685760006122a3600183612940565b85549091506000906122b790600190612940565b905081811461231c5760008660000182815481106122d7576122d76128ad565b90600052602060002001549050808760000184815481106122fa576122fa6128ad565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061232d5761232d612cd2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610690565b6000915050610690565b61237b81611f5a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61241a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016106bd565b600080846001600160a01b0316846040516124359190612ce8565b600060405180830381855af49150503d8060008114612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b509150915061249d8282604051806060016040528060278152602001612d45602791396124a6565b95945050505050565b606083156124b55750816113ec565b8251156124c55782518084602001fd5b8160405162461bcd60e51b81526004016106bd9190612c69565b6000602082840312156124f157600080fd5b81356001600160e01b0319811681146113ec57600080fd5b80356001600160a01b038116811461252057600080fd5b919050565b6000806040838503121561253857600080fd5b61254183612509565b946020939093013593505050565b60006020828403121561256157600080fd5b5035919050565b60008083601f84011261257a57600080fd5b50813567ffffffffffffffff81111561259257600080fd5b6020830191508360208260051b85010111156125ad57600080fd5b9250929050565b600080602083850312156125c757600080fd5b823567ffffffffffffffff8111156125de57600080fd5b6125ea85828601612568565b90969095509350505050565b60006020828403121561260857600080fd5b6113ec82612509565b6000806040838503121561262457600080fd5b8235915061263460208401612509565b90509250929050565b60008060006060848603121561265257600080fd5b8335925061266260208501612509565b915061267060408501612509565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156126a257600080fd5b6126ab83612509565b9150602083013567ffffffffffffffff808211156126c857600080fd5b818501915085601f8301126126dc57600080fd5b8135818111156126ee576126ee612679565b604051601f8201601f19908116603f0116810190838211818310171561271657612716612679565b8160405282815288602084870101111561272f57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561276457600080fd5b50508035926020909101359150565b60008060008060006080868803121561278b57600080fd5b853560ff8116811461279c57600080fd5b9450602086013567ffffffffffffffff8111156127b857600080fd5b6127c488828901612568565b9699909850959660408101359660609091013595509350505050565b60008060008060008060c087890312156127f957600080fd5b8635955060208701356004811061280f57600080fd5b94506040870135935061282460608801612509565b925061283260808801612509565b915061284060a08801612509565b90509295509295509295565b6000806040838503121561285f57600080fd5b61286883612509565b915061263460208401612509565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156128ed576128ed6128c3565b5060010190565b60208082528181018390526000908460408401835b86811015612935576001600160a01b0361292284612509565b1682529183019190830190600101612909565b509695505050505050565b600082821015612952576129526128c3565b500390565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526021908201527f73656e64657220646f65736e27742068617665206f70657261746f7220726f6c6040820152606560f81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215612a5857600080fd5b815180151581146113ec57600080fd5b60048110612a8657634e487b7160e01b600052602160045260246000fd5b9052565b84815260808101612a9e6020830186612a68565b60408201939093526001600160a01b039190911660609091015292915050565b868152612ace6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c08201819052601690820152754552433230207472616e73666572206661696c75726560501b6101008201526101200192915050565b868152612b3d6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c0820181905260119082015270496e76616c696420746f6b656e5479706560781b6101008201526101200192915050565b60008219821115612baa57612baa6128c3565b500190565b600060208284031215612bc157600080fd5b5051919050565b60005b83811015612be3578181015183820152602001612bcb565b8381111561201b5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612c2c816017850160208801612bc8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612c5d816028840160208801612bc8565b01602801949350505050565b6020815260008251806020840152612c88816040850160208701612bc8565b601f01601f19169190910160400192915050565b6000816000190483118215151615612cb657612cb66128c3565b500290565b600081612cca57612cca6128c3565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251612cfa818460208701612bc8565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e7d68946286ca3eb2289bc1ca1dca49ddf75e44f75d01b4f93482f683a7f846264736f6c63430008090033", + "deployedBytecode": "0x6080604052600436106101f95760003560e01c80635e1fab0f1161010d578063bcca7b1d116100a0578063dd62ed3e1161006f578063dd62ed3e1461058a578063e24814d6146105d1578063e2b0df8f146105fe578063f5b541a614610615578063f72c0d8b1461063757600080fd5b8063bcca7b1d14610522578063ca15c87314610542578063d0e30db014610562578063d547741f1461056a57600080fd5b806391d14854116100dc57806391d14854146104ad578063a19ba036146104cd578063a217fddf146104ed578063b4d89a071461050257600080fd5b80635e1fab0f1461042057806378226fe71461044057806379c0fb6e146104555780639010d07c1461047557600080fd5b80632e1a7d4d116101905780633d0594d41161015f5780633d0594d4146103a95780634f1ef286146103c957806352d1902d146103dc578063562c2d1d146103f15780635c975abb1461040857600080fd5b80632e1a7d4d146103295780632f2ff15d1461034957806336568abe146103695780633659cfe61461038957600080fd5b80631322a2a5116101cc5780631322a2a51461027d578063248a9ca31461029d57806326224c64146102db5780632752a46e1461030957600080fd5b806301ffc9a7146101fe5780630227c93614610233578063095ea7b31461024a5780630c8a263c1461025d575b600080fd5b34801561020a57600080fd5b5061021e6102193660046124df565b61066b565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b50610248610696565b005b61021e610258366004612525565b6106d0565b34801561026957600080fd5b5061024861027836600461254f565b61087e565b34801561028957600080fd5b506102486102983660046125b4565b6108fa565b3480156102a957600080fd5b506102cd6102b836600461254f565b60009081526097602052604090206001015490565b60405190815260200161022a565b3480156102e757600080fd5b506102cd6102f63660046125f6565b6101616020526000908152604090205481565b34801561031557600080fd5b506102486103243660046125b4565b610a1c565b34801561033557600080fd5b5061024861034436600461254f565b610b9b565b34801561035557600080fd5b50610248610364366004612611565b610ccc565b34801561037557600080fd5b50610248610384366004612611565b610cf6565b34801561039557600080fd5b506102486103a43660046125f6565b610d74565b3480156103b557600080fd5b506102486103c436600461263d565b610e54565b6102486103d736600461268f565b61113b565b3480156103e857600080fd5b506102cd611208565b3480156103fd57600080fd5b506102cd61015f5481565b34801561041457600080fd5b5060335460ff1661021e565b34801561042c57600080fd5b5061024861043b3660046125f6565b6112bb565b34801561044c57600080fd5b50610248611348565b34801561046157600080fd5b5061024861047036600461254f565b611377565b34801561048157600080fd5b50610495610490366004612751565b6113d4565b6040516001600160a01b03909116815260200161022a565b3480156104b957600080fd5b5061021e6104c8366004612611565b6113f3565b3480156104d957600080fd5b506102486104e836600461254f565b61141e565b3480156104f957600080fd5b506102cd600081565b34801561050e57600080fd5b5061024861051d366004612773565b61147b565b34801561052e57600080fd5b5061024861053d3660046127e0565b611657565b34801561054e57600080fd5b506102cd61055d36600461254f565b611930565b610248611947565b34801561057657600080fd5b50610248610585366004612611565b611a43565b34801561059657600080fd5b506102cd6105a536600461284c565b6001600160a01b0391821660009081526101626020908152604080832093909416825291909152205490565b3480156105dd57600080fd5b50610163546105ec9060ff1681565b60405160ff909116815260200161022a565b34801561060a57600080fd5b506102cd6101605481565b34801561062157600080fd5b506102cd600080516020612d2583398151915281565b34801561064357600080fd5b506102cd7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b60006001600160e01b03198216635a05180f60e01b1480610690575061069082611a68565b92915050565b6106a16000336113f3565b6106c65760405162461bcd60e51b81526004016106bd90612876565b60405180910390fd5b6106ce611a9d565b565b60006106da611af7565b338061073a5760405162461bcd60e51b815260206004820152602960248201527f4d696e6957616c6c65743a20617070726f76652066726f6d20746865207a65726044820152686f206164647265737360b81b60648201526084016106bd565b6001600160a01b0384166107a05760405162461bcd60e51b815260206004820152602760248201527f4d696e6957616c6c65743a20617070726f766520746f20746865207a65726f206044820152666164647265737360c81b60648201526084016106bd565b61015f548311156108095760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a20617070726f76652067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b341561081757610817611947565b6001600160a01b038181166000818152610162602090815260408083209489168084529482529182902087905590518681527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6108896000336113f3565b6108a55760405162461bcd60e51b81526004016106bd90612876565b6108ae81611b3d565b610163805460ff191660ff929092169190911790556040518181527fdd30dc35fb86c568de39420f82e371835e8392fdbf6828c67e685a87f115a910906020015b60405180910390a150565b6109056000336113f3565b6109215760405162461bcd60e51b81526004016106bd90612876565b60005b818110156109de576000838383818110610940576109406128ad565b905060200201602081019061095591906125f6565b905061096f600080516020612d25833981519152826113f3565b6109b35760405162461bcd60e51b81526020600482015260156024820152743932b6b7bb34b733903737b716b7b832b930ba37b960591b60448201526064016106bd565b6109cb600080516020612d2583398151915282611a43565b50806109d6816128d9565b915050610924565b507fd045926746dab8a5acf225487f413b986460165cf50f6052689a2e471198e0598282604051610a109291906128f4565b60405180910390a15050565b610a276000336113f3565b610a435760405162461bcd60e51b81526004016106bd90612876565b60005b81811015610b69576000838383818110610a6257610a626128ad565b9050602002016020810190610a7791906125f6565b9050610a91600080516020612d25833981519152826113f3565b15610ade5760405162461bcd60e51b815260206004820152601960248201527f616c726561647920686173206f70657261746f7220726f6c650000000000000060448201526064016106bd565b6101635460ff16610afc600080516020612d25833981519152611930565b10610b3e5760405162461bcd60e51b8152602060048201526012602482015271746f6f206d616e79206f70657261746f727360701b60448201526064016106bd565b610b56600080516020612d2583398151915282610ccc565b5080610b61816128d9565b915050610a46565b507f4c022f03c292dfa42133bfa9f90bbf55089da679c2df97df205f337c12ab7b7c8282604051610a109291906128f4565b610ba3611af7565b336000908152610161602052604090205481610bbd578091505b80821115610c305760405163993995bb60e01b8152336004820152602481018390526044810182905260806064820152602560848201527f496e73756666696369656e74206c6f636b65642066756e647320746f2077697460a482015264686472617760d81b60c482015260e4016106bd565b6000610c3c8383612940565b336000818152610161602052604080822084905551929350909185156108fc0291869190818181858888f19350505050158015610c7d573d6000803e3d6000fd5b503360008181526101616020908152604091829020548251878152918201527ffb59733a8f0bd43414922fb86c6ffdd090e44935074086318980ca89221acc56910160405180910390a2505050565b600082815260976020526040902060010154610ce781611b94565b610cf18383611b9e565b505050565b6001600160a01b0381163314610d665760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106bd565b610d708282611bc0565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610dbd5760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e06600080516020612d05833981519152546001600160a01b031690565b6001600160a01b031614610e2c5760405162461bcd60e51b81526004016106bd906129a3565b610e3581611be2565b60408051600080825260208201909252610e5191839190611c0c565b50565b610e6c600080516020612d25833981519152336113f3565b610e885760405162461bcd60e51b81526004016106bd906129ef565b610e90611af7565b6001600160a01b0382811660009081526101616020908152604080832054610162835281842094861684529390915290205484610f3d57604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152601a60c48201527f53656e6420616d6f756e742063616e6e6f7420657175616c203000000000000060e4820152610104016106bd565b81851115610fc657604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602160c48201527f496e73756666696369656e74206c6f636b65642066756e647320746f2073656e60e4820152601960fa1b610104820152610124016106bd565b8085111561105157604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602360c48201527f496e73756666696369656e7420617070726f7665642066756e647320746f207360e482015262195b9960ea1b610104820152610124016106bd565b600061105d8684612940565b6001600160a01b0386166000908152610161602052604081208290559091506110868784612940565b6001600160a01b03808816600090815261016260209081526040808320938a168084529390915280822084905551929350909189156108fc02918a9190818181858888f193505050501580156110e0573d6000803e3d6000fd5b5060408051888152602081018490529081018290526001600160a01b0380871691908816907f097db31093a1dfbc4fca0de24d2ea0d787b2de44c5fce71552714981745334e29060600160405180910390a350505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156111845760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111cd600080516020612d05833981519152546001600160a01b031690565b6001600160a01b0316146111f35760405162461bcd60e51b81526004016106bd906129a3565b6111fc82611be2565b610d7082826001611c0c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112a85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106bd565b50600080516020612d0583398151915290565b6112c66000336113f3565b6112e25760405162461bcd60e51b81526004016106bd90612876565b336001600160a01b03821614156113325760405162461bcd60e51b815260206004820152601460248201527331b0b73737ba103932b737bab731b29039b2b63360611b60448201526064016106bd565b61133d600082610ccc565b610e51600033610cf6565b6113536000336113f3565b61136f5760405162461bcd60e51b81526004016106bd90612876565b6106ce611d86565b6113826000336113f3565b61139e5760405162461bcd60e51b81526004016106bd90612876565b61015f8190556040518181527fec0d2c2f3a2fec7d9ce81f6f984ece08f0cdf867116717553c179253c65dca00906020016108ef565b600082815260c9602052604081206113ec9083611dbf565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6114296000336113f3565b6114455760405162461bcd60e51b81526004016106bd90612876565b6101608190556040518181527f0595560a63185cdb6922ec5f6b5279ada789aeea2ab360c554dfc94c0b19cc30906020016108ef565b600054610100900460ff161580801561149b5750600054600160ff909116105b806114b55750303b1580156114b5575060005460ff166001145b6115185760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106bd565b6000805460ff19166001179055801561153b576000805461ff0019166101001790555b337fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610381905561156b600082611dcb565b6115957f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e333611b9e565b610163805460ff191660ff891617905560005b858110156115fb576115e9600080516020612d258339815191528888848181106115d4576115d46128ad565b905060200201602081019061036491906125f6565b806115f3816128d9565b9150506115a8565b505061016083905561015f829055801561164f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61166f600080516020612d25833981519152336113f3565b61168b5760405162461bcd60e51b81526004016106bd906129ef565b611693611af7565b60008560038111156116a7576116a7612a30565b14156117c4576040516323b872dd60e01b81526001600160a01b038381166004830152828116602483015260448201889052600091908516906323b872dd90606401602060405180830381600087803b15801561170357600080fd5b505af1158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173b9190612a46565b9050801561179957816001600160a01b0316836001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db388989898960405161178c9493929190612a8a565b60405180910390a36117be565b8686868686866040516332ee88b960e11b81526004016106bd96959493929190612abe565b5061164f565b60018560038111156117d8576117d8612a30565b141561189f57604051632142170760e11b81526001600160a01b0383811660048301528281166024830152604482018690528416906342842e0e906064015b600060405180830381600087803b15801561183157600080fd5b505af1158015611845573d6000803e3d6000fd5b50505050806001600160a01b0316826001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db38888888886040516118929493929190612a8a565b60405180910390a361164f565b60028560038111156118b3576118b3612a30565b141561190b57604051637921219560e11b81526001600160a01b0383811660048301528281166024830152604482018690526064820188905260a06084830152600060a483015284169063f242432a9060c401611817565b8585858585856040516332ee88b960e11b81526004016106bd96959493929190612b2d565b600081815260c96020526040812061069090611dd5565b61194f611af7565b61016054336000908152610161602052604090205461196f903490612b97565b11156119d35760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a206465706f7369742067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b3360009081526101616020526040812080543492906119f3908490612b97565b90915550503360008181526101616020908152604091829020548251348152918201527f61bb8b82654398e0bdd4e0d489b5e9104b6840211fd89f7264264c96589051fd910160405180910390a2565b600082815260976020526040902060010154611a5e81611b94565b610cf18383611bc0565b60006001600160e01b03198216637965db0b60e01b148061069057506301ffc9a760e01b6001600160e01b0319831614610690565b611aa5611af7565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ada3390565b6040516001600160a01b03909116815260200160405180910390a1565b60335460ff16156106ce5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106bd565b60006101008210611b905760405162461bcd60e51b815260206004820152601c60248201527f76616c756520646f6573206e6f742066697420696e203820626974730000000060448201526064016106bd565b5090565b610e518133611ddf565b611ba88282611e43565b600082815260c960205260409020610cf19082611ec9565b611bca8282611ede565b600082815260c960205260409020610cf19082611f45565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610d7081611b94565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c3f57610cf183611f5a565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7857600080fd5b505afa925050508015611ca8575060408051601f3d908101601f19168201909252611ca591810190612baf565b60015b611d0b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016106bd565b600080516020612d058339815191528114611d7a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016106bd565b50610cf1838383611ff6565b611d8e612021565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611ada565b60006113ec838361206a565b610d708282611b9e565b6000610690825490565b611de982826113f3565b610d7057611e01816001600160a01b03166014612094565b611e0c836020612094565b604051602001611e1d929190612bf4565b60408051601f198184030181529082905262461bcd60e51b82526106bd91600401612c69565b611e4d82826113f3565b610d705760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611e853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113ec836001600160a01b038416612230565b611ee882826113f3565b15610d705760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006113ec836001600160a01b03841661227f565b6001600160a01b0381163b611fc75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016106bd565b600080516020612d0583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611fff83612372565b60008251118061200c5750805b15610cf15761201b83836123b2565b50505050565b60335460ff166106ce5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106bd565b6000826000018281548110612081576120816128ad565b9060005260206000200154905092915050565b606060006120a3836002612c9c565b6120ae906002612b97565b67ffffffffffffffff8111156120c6576120c6612679565b6040519080825280601f01601f1916602001820160405280156120f0576020820181803683370190505b509050600360fc1b8160008151811061210b5761210b6128ad565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061213a5761213a6128ad565b60200101906001600160f81b031916908160001a905350600061215e846002612c9c565b612169906001612b97565b90505b60018111156121e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061219d5761219d6128ad565b1a60f81b8282815181106121b3576121b36128ad565b60200101906001600160f81b031916908160001a90535060049490941c936121da81612cbb565b905061216c565b5083156113ec5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106bd565b600081815260018301602052604081205461227757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610690565b506000610690565b600081815260018301602052604081205480156123685760006122a3600183612940565b85549091506000906122b790600190612940565b905081811461231c5760008660000182815481106122d7576122d76128ad565b90600052602060002001549050808760000184815481106122fa576122fa6128ad565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061232d5761232d612cd2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610690565b6000915050610690565b61237b81611f5a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61241a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016106bd565b600080846001600160a01b0316846040516124359190612ce8565b600060405180830381855af49150503d8060008114612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b509150915061249d8282604051806060016040528060278152602001612d45602791396124a6565b95945050505050565b606083156124b55750816113ec565b8251156124c55782518084602001fd5b8160405162461bcd60e51b81526004016106bd9190612c69565b6000602082840312156124f157600080fd5b81356001600160e01b0319811681146113ec57600080fd5b80356001600160a01b038116811461252057600080fd5b919050565b6000806040838503121561253857600080fd5b61254183612509565b946020939093013593505050565b60006020828403121561256157600080fd5b5035919050565b60008083601f84011261257a57600080fd5b50813567ffffffffffffffff81111561259257600080fd5b6020830191508360208260051b85010111156125ad57600080fd5b9250929050565b600080602083850312156125c757600080fd5b823567ffffffffffffffff8111156125de57600080fd5b6125ea85828601612568565b90969095509350505050565b60006020828403121561260857600080fd5b6113ec82612509565b6000806040838503121561262457600080fd5b8235915061263460208401612509565b90509250929050565b60008060006060848603121561265257600080fd5b8335925061266260208501612509565b915061267060408501612509565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156126a257600080fd5b6126ab83612509565b9150602083013567ffffffffffffffff808211156126c857600080fd5b818501915085601f8301126126dc57600080fd5b8135818111156126ee576126ee612679565b604051601f8201601f19908116603f0116810190838211818310171561271657612716612679565b8160405282815288602084870101111561272f57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561276457600080fd5b50508035926020909101359150565b60008060008060006080868803121561278b57600080fd5b853560ff8116811461279c57600080fd5b9450602086013567ffffffffffffffff8111156127b857600080fd5b6127c488828901612568565b9699909850959660408101359660609091013595509350505050565b60008060008060008060c087890312156127f957600080fd5b8635955060208701356004811061280f57600080fd5b94506040870135935061282460608801612509565b925061283260808801612509565b915061284060a08801612509565b90509295509295509295565b6000806040838503121561285f57600080fd5b61286883612509565b915061263460208401612509565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156128ed576128ed6128c3565b5060010190565b60208082528181018390526000908460408401835b86811015612935576001600160a01b0361292284612509565b1682529183019190830190600101612909565b509695505050505050565b600082821015612952576129526128c3565b500390565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526021908201527f73656e64657220646f65736e27742068617665206f70657261746f7220726f6c6040820152606560f81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215612a5857600080fd5b815180151581146113ec57600080fd5b60048110612a8657634e487b7160e01b600052602160045260246000fd5b9052565b84815260808101612a9e6020830186612a68565b60408201939093526001600160a01b039190911660609091015292915050565b868152612ace6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c08201819052601690820152754552433230207472616e73666572206661696c75726560501b6101008201526101200192915050565b868152612b3d6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c0820181905260119082015270496e76616c696420746f6b656e5479706560781b6101008201526101200192915050565b60008219821115612baa57612baa6128c3565b500190565b600060208284031215612bc157600080fd5b5051919050565b60005b83811015612be3578181015183820152602001612bcb565b8381111561201b5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612c2c816017850160208801612bc8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612c5d816028840160208801612bc8565b01602801949350505050565b6020815260008251806020840152612c88816040850160208701612bc8565b601f01601f19169190910160400192915050565b6000816000190483118215151615612cb657612cb66128c3565b500290565b600081612cca57612cca6128c3565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251612cfa818460208701612bc8565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e7d68946286ca3eb2289bc1ca1dca49ddf75e44f75d01b4f93482f683a7f846264736f6c63430008090033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/miniserver/blockchain.js b/miniserver/blockchain.js index cdad84b..9831e91 100644 --- a/miniserver/blockchain.js +++ b/miniserver/blockchain.js @@ -72,6 +72,8 @@ const sampleExecutionAddress = () => { // basic executor used to send funds const prepareExecute = (logger = Logger.log, abortUnlessRPCError = true) => async (method, ...params) => { + console.log(`method: ${method}`) + console.log(`params: ${JSON.stringify(params)}`) const fromIndex = sampleExecutionAddress() const from = signers[fromIndex].address const miniWalletSigner = miniWallet.connect(signers[fromIndex]) diff --git a/miniserver/routes/index.js b/miniserver/routes/index.js index 39e7720..ef04934 100644 --- a/miniserver/routes/index.js +++ b/miniserver/routes/index.js @@ -58,25 +58,25 @@ const parseSMS = async (req, res, next) => { return respond(`error: pay request requires a valid amount': ${smsParams[2]} example request "p +14158401999 0.1"`) } const amount = ethers.utils.parseEther(smsParams[2]) - let toAddress + let funderAddress // Allow requesting of funds from users by address (without checking registered phone number) if (smsParams[1].substr(0, 2) === '0x') { if (!isValidAddress(smsParams[1])) { return respond(`error: invalid funder address ${smsParams[1]}. example request "p 0x8ba1f109551bd432803012645ac136ddd64dba72 0.1"`) } - toAddress = checkSumAddress(smsParams[1]) + funderAddress = checkSumAddress(smsParams[1]) } else { const { isValid, phoneNumber } = phone(smsParams[1], smsParams[1] === '+' ? undefined : phone(u.phone).countryIso3) if (!isValid) { - return respond(`error: invalid recipient phone number ${smsParams[1]}. example request "p +14158401999 0.1"`) + return respond(`error: invalid funders phone number ${smsParams[1]}. example request "p +14158401999 0.1"`) } const u2 = await User.findByPhone({ phone: phoneNumber }) if (!u2?.address) { return respond(`error: funders phone number is not a registered wallet: ${smsParams[1]}. example request "p +14158401999 0.1"`) } - toAddress = u2.address + funderAddress = u2.address } - req.processedBody = { ...req.processedBody, command: 'pay', fromAddress: u.address, toAddress, amount } + req.processedBody = { ...req.processedBody, command: 'pay', fromAddress: funderAddress, toAddress: u.address, amount } return next() } return respond('error: invalid sms command. example payment request "p +14158401999 0.1"') diff --git a/miniwallet/.env.example b/miniwallet/.env.example index ef738f3..fdb3c1d 100644 --- a/miniwallet/.env.example +++ b/miniwallet/.env.example @@ -19,9 +19,9 @@ MINIWALLET_INITIAL_OPERATORS=["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","0x70 MINIWALLET_INITIAL_USER_LIMIT=1000000 MINIWALLET_INITIAL_AUTH_LIMIT=100000 -# Smart Contract Testing config +# Smart Contract ethlocal config ## MiniWallet -TEST_MINIWALLET_INITIAL_OPERATOR_THRESHOLD=10 -TEST_MINIWALLET_INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"] -TEST_MINIWALLET_INITIAL_USER_LIMIT=1000 -TEST_MINIWALLET_INITIAL_AUTH_LIMIT=100 +ETH_LOCAL_MINIWALLET_INITIAL_OPERATOR_THRESHOLD=10 +ETH_LOCAL_MINIWALLET_INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"] +ETH_LOCAL_MINIWALLET_INITIAL_USER_LIMIT=1000 +ETH_LOCAL_MINIWALLET_INITIAL_AUTH_LIMIT=100 diff --git a/miniwallet/config.test.ts b/miniwallet/config.test.ts index a1fe8de..86aad72 100644 --- a/miniwallet/config.test.ts +++ b/miniwallet/config.test.ts @@ -7,7 +7,7 @@ export default { user: process.env.TEST_USER || '0xEf4634BdBc6F6528EacB49278d7E17BCB9e2689A', creator: process.env.TEST_CREATOR || '0x1cf6490889A92371fdBC610C4A862061F28BaFfA', miniWallet: { - initialOperatorThreshold: process.env.TEST_MINIWALLET_INITIAL_OPERATOR_THRESHOLD, + initialOperatorThreshold: process.env.TEST_MINIWALLET_INITIAL_OPERATOR_THRESHOLD || '10', initialOperators: JSON.parse(process.env.TEST_MINIWALLET_INITIAL_OPERATORS || '[]'), initialUserLimit: ethers.utils.parseEther(process.env.TEST_MINIWALLET_INIITIAL_USER_LIMIT || '1000'), initialAuthLimit: ethers.utils.parseEther(process.env.TEST_MINIWALLET_INIITIAL_AUTH_LIMIT || '100') diff --git a/miniwallet/config.ts b/miniwallet/config.ts index c726339..cb6af53 100644 --- a/miniwallet/config.ts +++ b/miniwallet/config.ts @@ -4,10 +4,18 @@ import 'dotenv/config' export default { mainnet: { miniWallet: { - initialOperatorThreshold: process.env.MINIWALLET_INITIAL_OPERATOR_THRESHOLD, + initialOperatorThreshold: process.env.MINIWALLET_INITIAL_OPERATOR_THRESHOLD || '100', initialOperators: JSON.parse(process.env.MINIWALLET_INITIAL_OPERATORS || '[]'), initialUserLimit: ethers.utils.parseEther(process.env.MINIWALLET_INIITIAL_USER_LIMIT || '1000000'), initialAuthLimit: ethers.utils.parseEther(process.env.MINIWALLET_INIITIAL_AUTH_LIMIT || '100000') } + }, + ethlocal: { + miniWallet: { + initialOperatorThreshold: process.env.ETH_LOCAL_MINIWALLET_INITIAL_OPERATOR_THRESHOLD || '10', + initialOperators: JSON.parse(process.env.ETH_LOCAL_MINIWALLET_INITIAL_OPERATORS || '[]'), + initialUserLimit: ethers.utils.parseEther(process.env.ETH_LOCAL_MINIWALLET_INIITIAL_USER_LIMIT || '1000'), + initialAuthLimit: ethers.utils.parseEther(process.env.ETH_LOCAL_MINIWALLET_INIITIAL_AUTH_LIMIT || '100') + } } } diff --git a/miniwallet/devlog/FEATURE_ROLLOUT.md b/miniwallet/devlog/FEATURE_ROLLOUT.md index 646c029..6d63f88 100644 --- a/miniwallet/devlog/FEATURE_ROLLOUT.md +++ b/miniwallet/devlog/FEATURE_ROLLOUT.md @@ -12,7 +12,7 @@ This section gives an overview of the features and github branches and pull requ **Issues** -- MiniWallet - Launch Task List [#13](https://github.com/polymorpher/sms-wallet/issues/13)] has been used to track work streams open PR's and completed Items. It also has some development logs and status updates. +- MiniWallet - Launch Task List [#13](https://github.com/polymorpher/sms-wallet/issues/13) has been used to track work streams open PR's and completed Items. It also has some development logs and status updates. **Pull Requests** @@ -47,7 +47,7 @@ These are ready for merge - MiniWallet Server: Allows users and creators to check their balances. Allows creators to request operators to send approved funds from users. - MiniWallet Tests: Coverage of all MiniWallet features. -**Branch and commits** +**Branch and commits v0** - Branch is [ws-miniwallet-v0](https://github.com/polymorpher/sms-wallet/tree/ws-miniwallet-v0) - Commits @@ -55,9 +55,10 @@ These are ready for merge - Copying of devlog [commit 6b246cb](https://github.com/polymorpher/sms-wallet/commit/6b246cb6fb09ff4d088e0f955a0cb1430dcf100a) - ignore deployments folder [commit 6da449f](https://github.com/polymorpher/sms-wallet/commit/6da449f3e90797e473b9131f7a7870fd2c779892) - Pruning of MiniId and MiniNFTs [commit 959ae0f](https://github.com/polymorpher/sms-wallet/commit/959ae0f650014cfc014e9db72403da0241fa6e19) + +**Branch and commits v0.1** - Adding in Proxy Changes [commit]() - Additional cleanup [commit]() - **Outstanding Items** * Replace Deployment with [native deployment](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/deploy/001_deploy_miniWallet.ts) will allow us to remove the unnecessary population of [ADMIN_SLOT](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/contracts/miniWallet/MiniWallet.sol#L377) @@ -181,7 +182,7 @@ ganachem #deploy miniwallet (separate window) and check settings in .env (miniserver) cdos cd miniwallet -yarn deploy --network ethLocal +yarn deploy --network ethlocal ``` ### Reset metamask account and fund wallet @@ -267,7 +268,7 @@ Following is an overview of the tests usually done **End to End Testing** -- `yarn deploy ethLocal` : Deploy all the contracts and mint test NFT's +- `yarn deploy ethlocal` : Deploy all the contracts and mint test NFT's - Reset metamask funding account - Transfer 20 ETH from admin to sms-wallet user `0x143A933E79931006b3Eb89cBc938587546faF159` - Transfer 20 ETH admin to sms-wallet creator `0x58bB8c7D2c90dF970fb01a5cD29c4075C41d3FFB` diff --git a/miniwallet/hardhat.config.ts b/miniwallet/hardhat.config.ts index 2d4a521..d300e47 100644 --- a/miniwallet/hardhat.config.ts +++ b/miniwallet/hardhat.config.ts @@ -60,7 +60,7 @@ const hardhatUserconfig: HardhatUserConfig = { auto: true } }, - ethLocal: { + ethlocal: { url: process.env.ETH_LOCAL_URL, gasPrice: 20000000000, gas: 6000000, diff --git a/server/yarn.lock b/server/yarn.lock index 264f31a..f4f83dc 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -598,21 +598,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" - integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/abstract-provider@5.6.1", "@ethersproject/abstract-provider@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz#02ddce150785caf0c77fe036a0ebfcee61878c59" @@ -626,19 +611,6 @@ "@ethersproject/transactions" "^5.6.2" "@ethersproject/web" "^5.6.1" -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" - integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - "@ethersproject/abstract-signer@5.6.2", "@ethersproject/abstract-signer@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz#491f07fc2cbd5da258f46ec539664713950b0b33" @@ -650,17 +622,6 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" - integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/address@5.6.1", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" @@ -672,17 +633,6 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/rlp" "^5.6.1" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" - integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/base64@5.6.1", "@ethersproject/base64@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.1.tgz#2c40d8a0310c9d1606c2c37ae3092634b41d87cb" @@ -690,13 +640,6 @@ dependencies: "@ethersproject/bytes" "^5.6.1" -"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" - integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/basex@5.6.1", "@ethersproject/basex@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.1.tgz#badbb2f1d4a6f52ce41c9064f01eab19cc4c5305" @@ -705,14 +648,6 @@ "@ethersproject/bytes" "^5.6.1" "@ethersproject/properties" "^5.6.0" -"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" - integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/bignumber@5.6.2", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.2.tgz#72a0717d6163fab44c47bcc82e0c550ac0315d66" @@ -722,15 +657,6 @@ "@ethersproject/logger" "^5.6.0" bn.js "^5.2.1" -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" - integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - "@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" @@ -738,13 +664,6 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" - integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== - dependencies: - "@ethersproject/logger" "^5.7.0" - "@ethersproject/constants@5.6.1", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370" @@ -752,13 +671,6 @@ dependencies: "@ethersproject/bignumber" "^5.6.2" -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" - integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/contracts@5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.2.tgz#20b52e69ebc1b74274ff8e3d4e508de971c287bc" @@ -775,22 +687,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/transactions" "^5.6.2" -"@ethersproject/contracts@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" - integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== - dependencies: - "@ethersproject/abi" "^5.7.0" - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/hash@5.6.1", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.1.tgz#224572ea4de257f05b4abf8ae58b03a67e99b0f4" @@ -805,21 +701,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" - integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/hdnode@5.6.2", "@ethersproject/hdnode@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.2.tgz#26f3c83a3e8f1b7985c15d1db50dc2903418b2d2" @@ -838,24 +719,6 @@ "@ethersproject/transactions" "^5.6.2" "@ethersproject/wordlists" "^5.6.1" -"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" - integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - "@ethersproject/json-wallets@5.6.1", "@ethersproject/json-wallets@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz#3f06ba555c9c0d7da46756a12ac53483fe18dd91" @@ -875,25 +738,6 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" - integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - "@ethersproject/keccak256@5.6.1", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.1.tgz#b867167c9b50ba1b1a92bccdd4f2d6bd168a91cc" @@ -902,24 +746,11 @@ "@ethersproject/bytes" "^5.6.1" js-sha3 "0.8.0" -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" - integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - js-sha3 "0.8.0" - "@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" - integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== - "@ethersproject/networks@5.6.4", "@ethersproject/networks@^5.6.3": version "5.6.4" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.4.tgz#51296d8fec59e9627554f5a8a9c7791248c8dc07" @@ -927,13 +758,6 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/networks@5.7.0", "@ethersproject/networks@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.0.tgz#df72a392f1a63a57f87210515695a31a245845ad" - integrity sha512-MG6oHSQHd4ebvJrleEQQ4HhVu8Ichr0RDYEfHzsVAVjHNM+w36x9wp9r+hf1JstMXtseXDtkiVoARAG6M959AA== - dependencies: - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2@5.6.1", "@ethersproject/pbkdf2@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz#f462fe320b22c0d6b1d72a9920a3963b09eb82d1" @@ -942,14 +766,6 @@ "@ethersproject/bytes" "^5.6.1" "@ethersproject/sha2" "^5.6.1" -"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" - integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" @@ -957,13 +773,6 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" - integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== - dependencies: - "@ethersproject/logger" "^5.7.0" - "@ethersproject/providers@5.6.8": version "5.6.8" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.8.tgz#22e6c57be215ba5545d3a46cf759d265bb4e879d" @@ -990,32 +799,6 @@ bech32 "1.1.4" ws "7.4.6" -"@ethersproject/providers@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.0.tgz#a885cfc7650a64385e7b03ac86fe9c2d4a9c2c63" - integrity sha512-+TTrrINMzZ0aXtlwO/95uhAggKm4USLm1PbeCBR/3XZ7+Oey+3pMyddzZEyRhizHpy1HXV0FRWRMI1O3EGYibA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - bech32 "1.1.4" - ws "7.4.6" - "@ethersproject/random@5.6.1", "@ethersproject/random@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.1.tgz#66915943981bcd3e11bbd43733f5c3ba5a790255" @@ -1024,14 +807,6 @@ "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" -"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" - integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/rlp@5.6.1", "@ethersproject/rlp@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.1.tgz#df8311e6f9f24dcb03d59a2bac457a28a4fe2bd8" @@ -1040,14 +815,6 @@ "@ethersproject/bytes" "^5.6.1" "@ethersproject/logger" "^5.6.0" -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" - integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/sha2@5.6.1", "@ethersproject/sha2@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.1.tgz#211f14d3f5da5301c8972a8827770b6fd3e51656" @@ -1057,15 +824,6 @@ "@ethersproject/logger" "^5.6.0" hash.js "1.1.7" -"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" - integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - hash.js "1.1.7" - "@ethersproject/signing-key@5.6.2", "@ethersproject/signing-key@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.2.tgz#8a51b111e4d62e5a62aee1da1e088d12de0614a3" @@ -1078,18 +836,6 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" - integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - bn.js "^5.2.1" - elliptic "6.5.4" - hash.js "1.1.7" - "@ethersproject/solidity@5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.1.tgz#5845e71182c66d32e6ec5eefd041fca091a473e2" @@ -1102,18 +848,6 @@ "@ethersproject/sha2" "^5.6.1" "@ethersproject/strings" "^5.6.1" -"@ethersproject/solidity@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" - integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/strings@5.6.1", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.1.tgz#dbc1b7f901db822b5cafd4ebf01ca93c373f8952" @@ -1123,15 +857,6 @@ "@ethersproject/constants" "^5.6.1" "@ethersproject/logger" "^5.6.0" -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" - integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/transactions@5.6.2", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.2.tgz#793a774c01ced9fe7073985bb95a4b4e57a6370b" @@ -1147,21 +872,6 @@ "@ethersproject/rlp" "^5.6.1" "@ethersproject/signing-key" "^5.6.2" -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" - integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/units@5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.1.tgz#ecc590d16d37c8f9ef4e89e2005bda7ddc6a4e6f" @@ -1171,15 +881,6 @@ "@ethersproject/constants" "^5.6.1" "@ethersproject/logger" "^5.6.0" -"@ethersproject/units@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" - integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/wallet@5.6.2": version "5.6.2" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.2.tgz#cd61429d1e934681e413f4bc847a5f2f87e3a03c" @@ -1201,27 +902,6 @@ "@ethersproject/transactions" "^5.6.2" "@ethersproject/wordlists" "^5.6.1" -"@ethersproject/wallet@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" - integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/json-wallets" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - "@ethersproject/web@5.6.1", "@ethersproject/web@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.1.tgz#6e2bd3ebadd033e6fe57d072db2b69ad2c9bdf5d" @@ -1233,17 +913,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" -"@ethersproject/web@5.7.0", "@ethersproject/web@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.0.tgz#40850c05260edad8b54827923bbad23d96aac0bc" - integrity sha512-ApHcbbj+muRASVDSCl/tgxaH2LBkRMEYfLOLVa0COipx0+nlu0QKet7U2lEg0vdkh8XRSLf2nd1f1Uk9SrVSGA== - dependencies: - "@ethersproject/base64" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/wordlists@5.6.1", "@ethersproject/wordlists@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.1.tgz#1e78e2740a8a21e9e99947e47979d72e130aeda1" @@ -1255,17 +924,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.1" -"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" - integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@google-cloud/datastore@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@google-cloud/datastore/-/datastore-7.0.0.tgz#e026db7d12c773230abf9e6b391a6196ef3fb81b" @@ -3970,42 +3628,6 @@ ethers@^5.0.13: "@ethersproject/web" "5.6.1" "@ethersproject/wordlists" "5.6.1" -ethers@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.0.tgz#0055da174b9e076b242b8282638bc94e04b39835" - integrity sha512-5Xhzp2ZQRi0Em+0OkOcRHxPzCfoBfgtOQA+RUylSkuHbhTEaQklnYi2hsWbRgs3ztJsXVXd9VKBcO1ScWL8YfA== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.0" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.0" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.0" - "@ethersproject/wordlists" "5.7.0" - ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" From 83e51d10d0ef1bcd1a7968d1ceb2ff5a3abb58f7 Mon Sep 17 00:00:00 2001 From: John Whitton Date: Mon, 19 Sep 2022 15:54:50 -0700 Subject: [PATCH 02/12] Update config so that testing and deploy work on hardhat --- miniwallet/.env.example | 7 +++++++ miniwallet/config.test.ts | 11 ++++------- miniwallet/config.ts | 8 ++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/miniwallet/.env.example b/miniwallet/.env.example index fdb3c1d..eaaf9ff 100644 --- a/miniwallet/.env.example +++ b/miniwallet/.env.example @@ -25,3 +25,10 @@ ETH_LOCAL_MINIWALLET_INITIAL_OPERATOR_THRESHOLD=10 ETH_LOCAL_MINIWALLET_INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"] ETH_LOCAL_MINIWALLET_INITIAL_USER_LIMIT=1000 ETH_LOCAL_MINIWALLET_INITIAL_AUTH_LIMIT=100 + +# Smart Contract hardhat config (used for testing e.g. in `yarn test`) +## MiniWallet +HARDHAT_MINIWALLET_INITIAL_OPERATOR_THRESHOLD=10 +HARDHAT_MINIWALLET_INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"] +HARDHAT_MINIWALLET_INITIAL_USER_LIMIT=1000 +HARDHAT_MINIWALLET_INITIAL_AUTH_LIMIT=100 \ No newline at end of file diff --git a/miniwallet/config.test.ts b/miniwallet/config.test.ts index 86aad72..645131c 100644 --- a/miniwallet/config.test.ts +++ b/miniwallet/config.test.ts @@ -3,14 +3,11 @@ import 'dotenv/config' export default { test: { - operator: JSON.parse(process.env.TEST_MINIWALLET_INITIAL_OPERATORS || '[]')[0] || '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - user: process.env.TEST_USER || '0xEf4634BdBc6F6528EacB49278d7E17BCB9e2689A', - creator: process.env.TEST_CREATOR || '0x1cf6490889A92371fdBC610C4A862061F28BaFfA', miniWallet: { - initialOperatorThreshold: process.env.TEST_MINIWALLET_INITIAL_OPERATOR_THRESHOLD || '10', - initialOperators: JSON.parse(process.env.TEST_MINIWALLET_INITIAL_OPERATORS || '[]'), - initialUserLimit: ethers.utils.parseEther(process.env.TEST_MINIWALLET_INIITIAL_USER_LIMIT || '1000'), - initialAuthLimit: ethers.utils.parseEther(process.env.TEST_MINIWALLET_INIITIAL_AUTH_LIMIT || '100') + initialOperatorThreshold: process.env.HARDHAT_MINIWALLET_INITIAL_OPERATOR_THRESHOLD || '10', + initialOperators: JSON.parse(process.env.HARDHAT_MINIWALLET_INITIAL_OPERATORS || '[]'), + initialUserLimit: ethers.utils.parseEther(process.env.HARDHAT_MINIWALLET_INIITIAL_USER_LIMIT || '1000'), + initialAuthLimit: ethers.utils.parseEther(process.env.HARDHAT_MINIWALLET_INIITIAL_AUTH_LIMIT || '100') } } } diff --git a/miniwallet/config.ts b/miniwallet/config.ts index cb6af53..5bb5727 100644 --- a/miniwallet/config.ts +++ b/miniwallet/config.ts @@ -17,5 +17,13 @@ export default { initialUserLimit: ethers.utils.parseEther(process.env.ETH_LOCAL_MINIWALLET_INIITIAL_USER_LIMIT || '1000'), initialAuthLimit: ethers.utils.parseEther(process.env.ETH_LOCAL_MINIWALLET_INIITIAL_AUTH_LIMIT || '100') } + }, + hardhat: { + miniWallet: { + initialOperatorThreshold: process.env.HARDHAT_MINIWALLET_INITIAL_OPERATOR_THRESHOLD || '10', + initialOperators: JSON.parse(process.env.HARDHAT_MINIWALLET_INITIAL_OPERATORS || '[]'), + initialUserLimit: ethers.utils.parseEther(process.env.HARDHAT_MINIWALLET_INIITIAL_USER_LIMIT || '1000'), + initialAuthLimit: ethers.utils.parseEther(process.env.HARDHAT_MINIWALLET_INIITIAL_AUTH_LIMIT || '100') + } } } From e493ae3e857904c1a7ef28abd3c2f224a46c1559 Mon Sep 17 00:00:00 2001 From: John Whitton Date: Mon, 19 Sep 2022 16:56:45 -0700 Subject: [PATCH 03/12] Update Test Tokens in mock and remove unused tokens in tests --- miniwallet/contracts/mocks/TestERC1155.sol | 56 +++++++ miniwallet/contracts/mocks/TestERC20.sol | 21 +++ miniwallet/contracts/mocks/TestERC721.sol | 44 ++++++ miniwallet/contracts/mocks/TestTokens.sol | 168 --------------------- miniwallet/contracts/proxy/MiniProxy.sol | 7 + miniwallet/test/admin.ts | 5 +- miniwallet/test/approve.ts | 5 +- miniwallet/test/transfer.ts | 5 +- 8 files changed, 132 insertions(+), 179 deletions(-) create mode 100644 miniwallet/contracts/mocks/TestERC1155.sol create mode 100644 miniwallet/contracts/mocks/TestERC20.sol create mode 100644 miniwallet/contracts/mocks/TestERC721.sol delete mode 100644 miniwallet/contracts/mocks/TestTokens.sol diff --git a/miniwallet/contracts/mocks/TestERC1155.sol b/miniwallet/contracts/mocks/TestERC1155.sol new file mode 100644 index 0000000..08cd46a --- /dev/null +++ b/miniwallet/contracts/mocks/TestERC1155.sol @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity ^0.8.4; + +import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; +import "@openzeppelin/contracts/access/AccessControl.sol"; + +/// @custom:security-contact dev@modulo.so +contract TestERC1155 is ERC1155, AccessControl { + bytes32 public constant URI_SETTER_ROLE = keccak256("URI_SETTER_ROLE"); + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + constructor(uint256[] memory tokenIds, uint256[] memory amounts) + ERC1155("ipfs://testerc1155.modulo.so/") + { + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(URI_SETTER_ROLE, msg.sender); + _grantRole(MINTER_ROLE, msg.sender); + for (uint32 i = 0; i < tokenIds.length; i++) { + mint(msg.sender, tokenIds[i], amounts[i], ""); + } + } + + function setURI(string memory newuri) public onlyRole(URI_SETTER_ROLE) { + _setURI(newuri); + } + + function mint( + address account, + uint256 id, + uint256 amount, + bytes memory data + ) public onlyRole(MINTER_ROLE) { + _mint(account, id, amount, data); + } + + function mintBatch( + address to, + uint256[] memory ids, + uint256[] memory amounts, + bytes memory data + ) public onlyRole(MINTER_ROLE) { + _mintBatch(to, ids, amounts, data); + } + + // The following functions are overrides required by Solidity. + + function supportsInterface(bytes4 interfaceId) + public + view + override(ERC1155, AccessControl) + returns (bool) + { + return super.supportsInterface(interfaceId); + } +} diff --git a/miniwallet/contracts/mocks/TestERC20.sol b/miniwallet/contracts/mocks/TestERC20.sol new file mode 100644 index 0000000..aa98737 --- /dev/null +++ b/miniwallet/contracts/mocks/TestERC20.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity ^0.8.4; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/access/AccessControl.sol"; + +/// @custom:security-contact dev@modulo.so +contract TestERC20 is ERC20, AccessControl { + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + + constructor(uint256 _amount) ERC20("TestERC20", "T20") { + _mint(msg.sender, _amount * 10**decimals()); + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(MINTER_ROLE, msg.sender); + } + + function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE) { + _mint(to, amount); + } +} diff --git a/miniwallet/contracts/mocks/TestERC721.sol b/miniwallet/contracts/mocks/TestERC721.sol new file mode 100644 index 0000000..d478ffb --- /dev/null +++ b/miniwallet/contracts/mocks/TestERC721.sol @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 + +pragma solidity ^0.8.4; + +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts/access/AccessControl.sol"; +import "@openzeppelin/contracts/utils/Counters.sol"; + +/// @custom:security-contact dev@modulo.so +contract TestERC721 is ERC721, AccessControl { + using Counters for Counters.Counter; + + bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); + Counters.Counter private _tokenIdCounter; + + constructor(uint256 _amount) ERC721("TestERC721", "T721") { + _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); + _grantRole(MINTER_ROLE, msg.sender); + for (uint32 i = 0; i < _amount; i++) { + safeMint(msg.sender); + } + } + + function _baseURI() internal pure override returns (string memory) { + return "ipfs://testerc721.modulo.so/"; + } + + function safeMint(address to) public onlyRole(MINTER_ROLE) { + uint256 tokenId = _tokenIdCounter.current(); + _tokenIdCounter.increment(); + _safeMint(to, tokenId); + } + + // The following functions are overrides required by Solidity. + + function supportsInterface(bytes4 interfaceId) + public + view + override(ERC721, AccessControl) + returns (bool) + { + return super.supportsInterface(interfaceId); + } +} diff --git a/miniwallet/contracts/mocks/TestTokens.sol b/miniwallet/contracts/mocks/TestTokens.sol deleted file mode 100644 index dca3c9c..0000000 --- a/miniwallet/contracts/mocks/TestTokens.sol +++ /dev/null @@ -1,168 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -pragma solidity ^0.8.9; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; -import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; - -contract TestERC20 is ERC20 { - string constant NAME = "Test20"; - string constant SYMBOL = "T20"; - address admin; - - constructor(uint256 _amount) ERC20(NAME, SYMBOL) { - admin = msg.sender; - _mint(msg.sender, _amount); - } - - modifier isAdmin() { - require(msg.sender == admin, "Only admin can do this"); - _; - } - - function mint(address dest, uint256 amount) public isAdmin { - ERC20._mint(dest, amount); - } - - function burn(address dest, uint256 amount) public isAdmin { - ERC20._burn(dest, amount); - } -} - -contract TestERC20Decimals9 is ERC20 { - string constant NAME = "Test20_D9"; - string constant SYMBOL = "T20D9"; - address admin; - - constructor(uint256 _amount) ERC20(NAME, SYMBOL) { - admin = msg.sender; - _mint(msg.sender, _amount); - } - - modifier isAdmin() { - require(msg.sender == admin, "Only admin can do this"); - _; - } - - function mint(address dest, uint256 amount) public isAdmin { - ERC20._mint(dest, amount); - } - - function burn(address dest, uint256 amount) public isAdmin { - ERC20._burn(dest, amount); - } - - function decimals() public pure override returns (uint8) { - return 9; - } -} - -contract TestERC721 is ERC721 { - string constant NAME = "Test721"; - string constant SYMBOL = "T721"; - address admin; - mapping(uint256 => string) uris; - - constructor(uint256[] memory tokenIds, string[] memory uris_) - ERC721(NAME, SYMBOL) - { - admin = msg.sender; - for (uint32 i = 0; i < tokenIds.length; i++) { - ERC721._mint(msg.sender, tokenIds[i]); - uris[tokenIds[i]] = uris_[i]; - } - } - - modifier isAdmin() { - require(msg.sender == admin, "Only admin can do this"); - _; - } - - function mint(address dest, uint256 tokenId) external isAdmin { - ERC721._mint(dest, tokenId); - } - - function burn(uint256 tokenId) external isAdmin { - ERC721._burn(tokenId); - } - - function setTokenUri(uint256 tokenId, string memory uri) external isAdmin { - uris[tokenId] = uri; - } - - function tokenURI(uint256 tokenId) - public - view - override - returns (string memory) - { - return uris[tokenId]; - } -} - -contract TestERC1155 is ERC1155 { - address admin; - mapping(uint256 => string) metadataUris; - - constructor( - uint256[] memory tokenIds, - uint256[] memory amounts, - string[] memory uris_ - ) ERC1155("") { - admin = msg.sender; - for (uint32 i = 0; i < tokenIds.length; i++) { - ERC1155._mint(msg.sender, tokenIds[i], amounts[i], ""); - metadataUris[tokenIds[i]] = uris_[i]; - } - } - - modifier isAdmin() { - require(msg.sender == admin, "Only admin can do this"); - _; - } - - function mint( - uint256 tokenId, - uint256 amount, - address dest, - string memory metadataUri - ) public isAdmin { - ERC1155._mint(dest, tokenId, amount, ""); - metadataUris[tokenId] = metadataUri; - } - - function payToMint( - uint256 tokenId, - uint256 amount, - address dest, - string memory metadataUri - ) external payable { - require(msg.value >= (amount * 1 ether), "Insufficient payment"); - uint256 excess = msg.value - (amount * 1 ether); - if (excess > 0) { - (bool success, bytes memory data) = msg.sender.call{value: excess}( - "" - ); - if (!success) revert(string(data)); - } - ERC1155._mint(dest, tokenId, amount, ""); - metadataUris[tokenId] = metadataUri; - } - - function setUri(uint256 id, string memory uri_) public isAdmin { - metadataUris[id] = uri_; - } - - function uri(uint256 id) public view override returns (string memory) { - return metadataUris[id]; - } - - function burn( - address dest, - uint256 tokenId, - uint256 amount - ) public isAdmin { - ERC1155._burn(dest, tokenId, amount); - } -} diff --git a/miniwallet/contracts/proxy/MiniProxy.sol b/miniwallet/contracts/proxy/MiniProxy.sol index cd87602..1702e57 100644 --- a/miniwallet/contracts/proxy/MiniProxy.sol +++ b/miniwallet/contracts/proxy/MiniProxy.sol @@ -28,6 +28,13 @@ contract MiniProxy is Proxy, ERC1967Upgrade { _upgradeToAndCall(_logic, _data, false); } + /** + * @dev Returns the current implementation address. + */ + function implementation() public view returns (address impl) { + return _implementation(); + } + /** * @dev Returns the current implementation address. */ diff --git a/miniwallet/test/admin.ts b/miniwallet/test/admin.ts index 8b779a6..6418f03 100644 --- a/miniwallet/test/admin.ts +++ b/miniwallet/test/admin.ts @@ -13,10 +13,7 @@ const DEFAULT_ADMIN_ROLE = '0x00000000000000000000000000000000000000000000000000 describe('MiniWallet Admin', function () { before(async function () { await prepare(this, [ - 'MiniWallet', - 'TestERC20', - 'TestERC721', - 'TestERC1155' + 'MiniWallet' ]) }) diff --git a/miniwallet/test/approve.ts b/miniwallet/test/approve.ts index aefa6f9..f78f308 100644 --- a/miniwallet/test/approve.ts +++ b/miniwallet/test/approve.ts @@ -14,10 +14,7 @@ const ONE_ETH = ethers.utils.parseEther('1') describe('MiniWallet', function () { before(async function () { await prepare(this, [ - 'MiniWallet', - 'TestERC20', - 'TestERC721', - 'TestERC1155' + 'MiniWallet' ]) }) diff --git a/miniwallet/test/transfer.ts b/miniwallet/test/transfer.ts index 50cd29d..a5d65e0 100644 --- a/miniwallet/test/transfer.ts +++ b/miniwallet/test/transfer.ts @@ -79,7 +79,7 @@ describe('MiniWallet', function () { it('MW-transfer-1: positive test of ERC721 transfer', async function () { // Deploy 721 - await deploy(this, [['erc721', this.TestERC721, [range(10), range(10).map((e: any) => `ipfs://test721/${e}`)]]]) + await deploy(this, [['erc721', this.TestERC721, [10]]]) // Transfer some Tokens for Alice let tx = await this.erc721.transferFrom(this.deployer.address, this.alice.address, 0) await tx.wait() @@ -110,8 +110,7 @@ describe('MiniWallet', function () { // Deploy 1155 await deploy(this, [['erc1155', this.TestERC1155, [ range(10), - range(10).map((e: any) => 10), // mint 10 for each - range(10).map((e: any) => `ipfs://test1155/${e}`) + range(10).map((e: any) => 10) // mint 10 for each ]]]) // Transfer some tokens for Alice let tx = await this.erc1155.safeTransferFrom(this.deployer.address, this.alice.address, 0, 7, DUMMY_HEX) From 6a00b8ec4be8154993c21cce8760175b5db6481b Mon Sep 17 00:00:00 2001 From: John Whitton Date: Mon, 19 Sep 2022 18:41:02 -0700 Subject: [PATCH 04/12] Improve tests to use Proxies --- miniwallet/test/admin.ts | 1 + miniwallet/test/approve.ts | 1 + miniwallet/test/deposit.ts | 1 + miniwallet/test/extra.ts | 6 ++---- miniwallet/test/send.ts | 1 + miniwallet/test/transfer.ts | 1 + miniwallet/test/utilities/index.ts | 16 +++++++++++----- miniwallet/test/withdraw.ts | 1 + 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/miniwallet/test/admin.ts b/miniwallet/test/admin.ts index 6418f03..1a1da62 100644 --- a/miniwallet/test/admin.ts +++ b/miniwallet/test/admin.ts @@ -13,6 +13,7 @@ const DEFAULT_ADMIN_ROLE = '0x00000000000000000000000000000000000000000000000000 describe('MiniWallet Admin', function () { before(async function () { await prepare(this, [ + 'MiniProxy', 'MiniWallet' ]) }) diff --git a/miniwallet/test/approve.ts b/miniwallet/test/approve.ts index f78f308..c3d2bf0 100644 --- a/miniwallet/test/approve.ts +++ b/miniwallet/test/approve.ts @@ -14,6 +14,7 @@ const ONE_ETH = ethers.utils.parseEther('1') describe('MiniWallet', function () { before(async function () { await prepare(this, [ + 'MiniProxy', 'MiniWallet' ]) }) diff --git a/miniwallet/test/deposit.ts b/miniwallet/test/deposit.ts index 3a9d289..e59c542 100644 --- a/miniwallet/test/deposit.ts +++ b/miniwallet/test/deposit.ts @@ -14,6 +14,7 @@ const ONE_ETH = ethers.utils.parseEther('1') describe('MiniWallet', function () { before(async function () { await prepare(this, [ + 'MiniProxy', 'MiniWallet' ]) }) diff --git a/miniwallet/test/extra.ts b/miniwallet/test/extra.ts index 65551f2..c1dc748 100644 --- a/miniwallet/test/extra.ts +++ b/miniwallet/test/extra.ts @@ -15,10 +15,8 @@ const INITIAL_BALANCE_ETH = ethers.utils.parseEther('10000') describe('MiniWallet', function () { before(async function () { await prepare(this, [ - 'MiniWallet', - 'TestERC20', - 'TestERC721', - 'TestERC1155' + 'MiniProxy', + 'MiniWallet' ]) }) diff --git a/miniwallet/test/send.ts b/miniwallet/test/send.ts index 0fac9d5..4dff4f7 100644 --- a/miniwallet/test/send.ts +++ b/miniwallet/test/send.ts @@ -14,6 +14,7 @@ const ONE_ETH = ethers.utils.parseEther('1') describe('MiniWallet', function () { before(async function () { await prepare(this, [ + 'MiniProxy', 'MiniWallet' ]) }) diff --git a/miniwallet/test/transfer.ts b/miniwallet/test/transfer.ts index a5d65e0..ac81002 100644 --- a/miniwallet/test/transfer.ts +++ b/miniwallet/test/transfer.ts @@ -19,6 +19,7 @@ const DUMMY_HEX = '0x' describe('MiniWallet', function () { before(async function () { await prepare(this, [ + 'MiniProxy', 'MiniWallet', 'TestERC20', 'TestERC721', diff --git a/miniwallet/test/utilities/index.ts b/miniwallet/test/utilities/index.ts index 244514f..37644a5 100644 --- a/miniwallet/test/utilities/index.ts +++ b/miniwallet/test/utilities/index.ts @@ -3,6 +3,10 @@ import { expect } from 'chai' import { MockProvider } from 'ethereum-waffle' import { Contract, BigNumber } from 'ethers' import { ethers } from 'hardhat' +// TODO Parameterize CallData +const ContractPath = '../../build/contracts/miniWallet/miniWallet.sol/MiniWallet.json' +const ContractJSON = require(ContractPath) +const { abi } = ContractJSON export const BASE_TEN = 10 @@ -32,11 +36,13 @@ export async function deploy (context, contracts) { export async function deployUpgradeable (testEnvironment, contracts) { for (const contract of contracts) { - testEnvironment[contract[0]] = await contract[1].deploy() - await testEnvironment[contract[0]].deployed() - const tx = await testEnvironment[contract[0]].initialize(...(contract[2] || [])) - await tx.wait() - // await ethers.provider.waitForTransaction(tx.hash) + const implementation = await contract[1].deploy() + await implementation.deployed() + const iface = new ethers.utils.Interface(abi) + const calldata = iface.encodeFunctionData('initialize', contract[2] || []) + const proxy = await testEnvironment.MiniProxy.deploy(implementation.address, calldata) + await proxy.deployed() + testEnvironment[contract[0]] = testEnvironment.MiniWallet.attach(proxy.address) } } diff --git a/miniwallet/test/withdraw.ts b/miniwallet/test/withdraw.ts index 440105a..d79a100 100644 --- a/miniwallet/test/withdraw.ts +++ b/miniwallet/test/withdraw.ts @@ -14,6 +14,7 @@ const ONE_ETH = ethers.utils.parseEther('1') describe('MiniWallet', function () { before(async function () { await prepare(this, [ + 'MiniProxy', 'MiniWallet' ]) }) From 07b9ee23dd44dbed291b86e876027826edec8740 Mon Sep 17 00:00:00 2001 From: John Whitton Date: Mon, 19 Sep 2022 19:50:36 -0700 Subject: [PATCH 05/12] Update FEATURE_ROLLOUT.md to include items for MiniID's and MiniNFTs --- miniwallet/devlog/FEATURE_ROLLOUT.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/miniwallet/devlog/FEATURE_ROLLOUT.md b/miniwallet/devlog/FEATURE_ROLLOUT.md index 6d63f88..6075ccb 100644 --- a/miniwallet/devlog/FEATURE_ROLLOUT.md +++ b/miniwallet/devlog/FEATURE_ROLLOUT.md @@ -57,8 +57,13 @@ These are ready for merge - Pruning of MiniId and MiniNFTs [commit 959ae0f](https://github.com/polymorpher/sms-wallet/commit/959ae0f650014cfc014e9db72403da0241fa6e19) **Branch and commits v0.1** - - Adding in Proxy Changes [commit]() - - Additional cleanup [commit]() +- Branch is [ws-miniwallet-v0.1](https://github.com/polymorpher/sms-wallet/tree/ws-miniwallet-v0.1) +- Pull Request is [ws-miniwallet-v0.1 MiniWallet Functionality](https://github.com/polymorpher/sms-wallet/pull/17) +- Commit Summary + - Ensure MiniWallet and MiniServer can be validated against ethLocal + - Update config so testing and deploy work on hardhat + - Improve Proxy based on Feedback and ensure tests use Proxies + **Outstanding Items** * Replace Deployment with [native deployment](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/deploy/001_deploy_miniWallet.ts) will allow us to remove the unnecessary population of [ADMIN_SLOT](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/contracts/miniWallet/MiniWallet.sol#L377) @@ -66,7 +71,6 @@ These are ready for merge **Future Work** * mulit-call functionality for support of multiple transactions such as authorizations. -* [PROXY Enhancements](https://github.com/polymorpher/sms-wallet/blob/ws-miniwallet-v0/miniwallet/devlog/PROXY.md): Including Deterministic Deployments and Persistence of artifacts. * Update Contract Testing to test administrative functions and what happens under different scenarios such as miniWallet paused. **Refactor Notes** @@ -85,10 +89,14 @@ git push --set-upstream origin ws-miniwallet-v0 These needs some improvement on fine-control over deploy and upgrade process (most likely can't just use simple hardhat calls / plugins anymore) and storing (not just logging) the addresses of proxy, logic, and storage **Key Features** - +- Deterministic Deployments - For Proxy Contracts +- LightWeight Persistence of Artifacts +- Multichain/MultiContract Deployment Process **Branch and commits** **Outstanding Items** +* [PROXY Enhancements](https://github.com/polymorpher/sms-wallet/blob/ws-miniwallet-v0/miniwallet/devlog/PROXY.md): Including Deterministic Deployments and Persistence of artifacts. +* [Configuration Enhancements](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/CONFIGURATION.md): ability to independently deploy (on multiple chains) and test each work stream. ### mini1155, 721, and related deployment scripts and tests @@ -96,6 +104,13 @@ These needs some improvement on fine-control over deploy and upgrade process (mo These need some sanitization and maybe some simplification on tests. They are pretty much ready for merge **Key Features** +* Operator NFT Collectibles Airdrop: Mini721: These are NFT collections airdropped by Operators to each Registered User. For Initial Phase we will use Minion Images. Attributes (TokenId, Phone, Address, Country) + +* User/Creator: Friends and Fans: Minted by MiniID Holders to friends/fans 1 to 1 correlation between MiniID TokenId and Mini1155 TokenId (one can issue multiple Mini1155 tokens of the same token ID to any address). Think of it as a friends list. It could also be event based, i.e. issued by the Owner before an event, and burned afterwards. Metadata attributes may include: IssuerTokenId, IssuerPhone, IssuerAddress, IssuerCountry + +* Creator NFT Collections: These are NFT collections (Mini721C) created by Creators (could have its own factory). For Initial Phase we will use Minion Images + +* Creator Access Passes: These are NFT Access Passes(Mini1155C) Given by Creators (could have its own factory) **Branch and commits** @@ -106,10 +121,15 @@ These need some sanitization and maybe some simplification on tests. They are pr These are incomplete **Key Features** +MiniID: Soulbound Token (assigned to a phone number, cannot be transferred), 1 per phone number. +* Displayable as a QR Code which encapsulates information including TokenId, Phone, Address, Country. **Branch and commits** **Outstanding Items** +* [Signup Flow](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/NFTID.md#sign-up-flow) +* [Airdrop Flow](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/NFTID.md#airdrop-flow) +* QR Code Generation: ### documentations (NFTID.md, PROXY.md) From f82d8125cfaed47ebbc7c701dde9ce218893264f Mon Sep 17 00:00:00 2001 From: John Whitton Date: Wed, 21 Sep 2022 11:54:07 -0700 Subject: [PATCH 06/12] Update supports interface in TestERC721.sol and TestERC1155.sol --- miniwallet/contracts/mocks/TestERC1155.sol | 12 +++++++++++- miniwallet/contracts/mocks/TestERC721.sol | 3 ++- miniwallet/devlog/FEATURE_ROLLOUT.md | 6 ++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/miniwallet/contracts/mocks/TestERC1155.sol b/miniwallet/contracts/mocks/TestERC1155.sol index 08cd46a..0d88711 100644 --- a/miniwallet/contracts/mocks/TestERC1155.sol +++ b/miniwallet/contracts/mocks/TestERC1155.sol @@ -51,6 +51,16 @@ contract TestERC1155 is ERC1155, AccessControl { override(ERC1155, AccessControl) returns (bool) { - return super.supportsInterface(interfaceId); + return (ERC1155.supportsInterface(interfaceId) || + AccessControl.supportsInterface(interfaceId)); } + + // function supportsInterface(bytes4 interfaceId) + // public + // view + // override(ERC1155, AccessControl) + // returns (bool) + // { + // return super.supportsInterface(interfaceId); + // } } diff --git a/miniwallet/contracts/mocks/TestERC721.sol b/miniwallet/contracts/mocks/TestERC721.sol index d478ffb..418b4ed 100644 --- a/miniwallet/contracts/mocks/TestERC721.sol +++ b/miniwallet/contracts/mocks/TestERC721.sol @@ -39,6 +39,7 @@ contract TestERC721 is ERC721, AccessControl { override(ERC721, AccessControl) returns (bool) { - return super.supportsInterface(interfaceId); + return (ERC721.supportsInterface(interfaceId) || + AccessControl.supportsInterface(interfaceId)); } } diff --git a/miniwallet/devlog/FEATURE_ROLLOUT.md b/miniwallet/devlog/FEATURE_ROLLOUT.md index 6075ccb..deab79a 100644 --- a/miniwallet/devlog/FEATURE_ROLLOUT.md +++ b/miniwallet/devlog/FEATURE_ROLLOUT.md @@ -68,6 +68,10 @@ These are ready for merge * Replace Deployment with [native deployment](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/deploy/001_deploy_miniWallet.ts) will allow us to remove the unnecessary population of [ADMIN_SLOT](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/contracts/miniWallet/MiniWallet.sol#L377) * Review MiniProxy.sol to ensure that we are happy with this UUPS compliant Proxy. If we decide to change the Proxy at a later point we will need to update contract addresses in miniserver and potentially other deployments. +* Type 2 Transactions +* Automatic Population of ABI's for miniserver +* Rewrite of test contracts +* **Future Work** * mulit-call functionality for support of multiple transactions such as authorizations. @@ -97,6 +101,8 @@ These needs some improvement on fine-control over deploy and upgrade process (mo **Outstanding Items** * [PROXY Enhancements](https://github.com/polymorpher/sms-wallet/blob/ws-miniwallet-v0/miniwallet/devlog/PROXY.md): Including Deterministic Deployments and Persistence of artifacts. * [Configuration Enhancements](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/CONFIGURATION.md): ability to independently deploy (on multiple chains) and test each work stream. +* Parameterizing callData for tests +* Incorporation of one-wallet lib ### mini1155, 721, and related deployment scripts and tests From 7ef7989e5d46c765cf13f8f61a2841dde3e08c1a Mon Sep 17 00:00:00 2001 From: John Whitton Date: Wed, 21 Sep 2022 12:53:45 -0700 Subject: [PATCH 07/12] Retreive gasPrice when executing miniserver transactions --- miniserver/blockchain.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/miniserver/blockchain.js b/miniserver/blockchain.js index 9831e91..ce2b85f 100644 --- a/miniserver/blockchain.js +++ b/miniserver/blockchain.js @@ -79,6 +79,7 @@ const prepareExecute = (logger = Logger.log, abortUnlessRPCError = true) => asyn const miniWalletSigner = miniWallet.connect(signers[fromIndex]) logger(`Sampled [${fromIndex}] ${from}`) const latestNonce = await rpc.getNonce({ address: from, network: config.defaultNetwork }) + const gasPrice = await rpc.gasPrice({ network: config.defaultNetwork }) const snapshotPendingNonces = pendingNonces[from] const nonce = latestNonce + snapshotPendingNonces pendingNonces[from] += 1 @@ -91,7 +92,7 @@ const prepareExecute = (logger = Logger.log, abortUnlessRPCError = true) => asyn const tx = await backOff( async () => miniWalletSigner[method](...params, { nonce, - gasPrice: ethers.BigNumber.from(config.gasPrice).mul((numAttempts || 0) + 1), + gasPrice: ethers.BigNumber.from(gasPrice).mul((numAttempts || 0) + 1), value: 0, }), { retry: (ex, n) => { From 357dec7f033d129bf1d3a321e90690bbe3e049bc Mon Sep 17 00:00:00 2001 From: John Whitton Date: Wed, 21 Sep 2022 16:52:56 -0700 Subject: [PATCH 08/12] improve getCallData and population of abis --- miniserver/abi/MiniProxy.json | 84 + miniserver/abi/MiniWallet.json | 2101 ++++++++++---------- miniserver/blockchain.js | 6 +- miniwallet/contracts/mocks/TestERC1155.sol | 9 - miniwallet/hardhat.config.ts | 7 +- miniwallet/test/utilities/index.ts | 7 +- miniwallet/tsconfig.json | 2 +- 7 files changed, 1139 insertions(+), 1077 deletions(-) create mode 100644 miniserver/abi/MiniProxy.json diff --git a/miniserver/abi/MiniProxy.json b/miniserver/abi/MiniProxy.json new file mode 100644 index 0000000..ecbf663 --- /dev/null +++ b/miniserver/abi/MiniProxy.json @@ -0,0 +1,84 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "impl", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/miniserver/abi/MiniWallet.json b/miniserver/abi/MiniWallet.json index ad7abba..f1ce3ab 100644 --- a/miniserver/abi/MiniWallet.json +++ b/miniserver/abi/MiniWallet.json @@ -1,1055 +1,1046 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "MiniWallet", - "sourceName": "contracts/miniWallet/MiniWallet.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "allowance", - "type": "uint256" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "SendFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "enum Enums.TokenType", - "name": "tokenType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "TransferFailed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "WithdrawalFailed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "allowance", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "name": "DepositSuccessful", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newGlobalUserAuthLimit", - "type": "uint256" - } - ], - "name": "GlobalUserAuthLimitChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newGlobalUserLimit", - "type": "uint256" - } - ], - "name": "GlobalUserLimitChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newThreshold", - "type": "uint256" - } - ], - "name": "OperatorThresholdChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "operators", - "type": "address[]" - } - ], - "name": "OperatorsAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "operators", - "type": "address[]" - } - ], - "name": "OperatorsRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "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": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newAllowance", - "type": "uint256" - } - ], - "name": "SendSuccessful", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "enum Enums.TokenType", - "name": "tokenType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "TransferSuccessful", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "balance", - "type": "uint256" - } - ], - "name": "WithdrawalSuccessful", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "UPGRADER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "operatorAddresses", - "type": "address[]" - } - ], - "name": "adminAddOperators", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGlobalUserAuthLimit", - "type": "uint256" - } - ], - "name": "adminChangeGlobalUserAuthLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newGlobalUserLimit", - "type": "uint256" - } - ], - "name": "adminChangeGlobalUserLimit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newThreshold", - "type": "uint256" - } - ], - "name": "adminChangeOperatorThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "adminPauseMiniWallet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "operatorAddresses", - "type": "address[]" - } - ], - "name": "adminRemoveOperators", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "adminUnpauseMiniWallet", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "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": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "deposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "getRoleMember", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleMemberCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "globalUserAuthLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "globalUserLimit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "initialOperatorThreshold", - "type": "uint8" - }, - { - "internalType": "address[]", - "name": "initialOperators", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "globalUserLimit_", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "globalUserAuthLimit_", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "operatorThreshold", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proxiableUUID", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "renounceAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "send", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "enum Enums.TokenType", - "name": "tokenType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transfer", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userBalances", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60a06040523060805234801561001457600080fd5b50608051612da161004c60003960008181610d7f01528181610dbf015281816111460152818161118601526112150152612da16000f3fe6080604052600436106101f95760003560e01c80635e1fab0f1161010d578063bcca7b1d116100a0578063dd62ed3e1161006f578063dd62ed3e1461058a578063e24814d6146105d1578063e2b0df8f146105fe578063f5b541a614610615578063f72c0d8b1461063757600080fd5b8063bcca7b1d14610522578063ca15c87314610542578063d0e30db014610562578063d547741f1461056a57600080fd5b806391d14854116100dc57806391d14854146104ad578063a19ba036146104cd578063a217fddf146104ed578063b4d89a071461050257600080fd5b80635e1fab0f1461042057806378226fe71461044057806379c0fb6e146104555780639010d07c1461047557600080fd5b80632e1a7d4d116101905780633d0594d41161015f5780633d0594d4146103a95780634f1ef286146103c957806352d1902d146103dc578063562c2d1d146103f15780635c975abb1461040857600080fd5b80632e1a7d4d146103295780632f2ff15d1461034957806336568abe146103695780633659cfe61461038957600080fd5b80631322a2a5116101cc5780631322a2a51461027d578063248a9ca31461029d57806326224c64146102db5780632752a46e1461030957600080fd5b806301ffc9a7146101fe5780630227c93614610233578063095ea7b31461024a5780630c8a263c1461025d575b600080fd5b34801561020a57600080fd5b5061021e6102193660046124df565b61066b565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b50610248610696565b005b61021e610258366004612525565b6106d0565b34801561026957600080fd5b5061024861027836600461254f565b61087e565b34801561028957600080fd5b506102486102983660046125b4565b6108fa565b3480156102a957600080fd5b506102cd6102b836600461254f565b60009081526097602052604090206001015490565b60405190815260200161022a565b3480156102e757600080fd5b506102cd6102f63660046125f6565b6101616020526000908152604090205481565b34801561031557600080fd5b506102486103243660046125b4565b610a1c565b34801561033557600080fd5b5061024861034436600461254f565b610b9b565b34801561035557600080fd5b50610248610364366004612611565b610ccc565b34801561037557600080fd5b50610248610384366004612611565b610cf6565b34801561039557600080fd5b506102486103a43660046125f6565b610d74565b3480156103b557600080fd5b506102486103c436600461263d565b610e54565b6102486103d736600461268f565b61113b565b3480156103e857600080fd5b506102cd611208565b3480156103fd57600080fd5b506102cd61015f5481565b34801561041457600080fd5b5060335460ff1661021e565b34801561042c57600080fd5b5061024861043b3660046125f6565b6112bb565b34801561044c57600080fd5b50610248611348565b34801561046157600080fd5b5061024861047036600461254f565b611377565b34801561048157600080fd5b50610495610490366004612751565b6113d4565b6040516001600160a01b03909116815260200161022a565b3480156104b957600080fd5b5061021e6104c8366004612611565b6113f3565b3480156104d957600080fd5b506102486104e836600461254f565b61141e565b3480156104f957600080fd5b506102cd600081565b34801561050e57600080fd5b5061024861051d366004612773565b61147b565b34801561052e57600080fd5b5061024861053d3660046127e0565b611657565b34801561054e57600080fd5b506102cd61055d36600461254f565b611930565b610248611947565b34801561057657600080fd5b50610248610585366004612611565b611a43565b34801561059657600080fd5b506102cd6105a536600461284c565b6001600160a01b0391821660009081526101626020908152604080832093909416825291909152205490565b3480156105dd57600080fd5b50610163546105ec9060ff1681565b60405160ff909116815260200161022a565b34801561060a57600080fd5b506102cd6101605481565b34801561062157600080fd5b506102cd600080516020612d2583398151915281565b34801561064357600080fd5b506102cd7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b60006001600160e01b03198216635a05180f60e01b1480610690575061069082611a68565b92915050565b6106a16000336113f3565b6106c65760405162461bcd60e51b81526004016106bd90612876565b60405180910390fd5b6106ce611a9d565b565b60006106da611af7565b338061073a5760405162461bcd60e51b815260206004820152602960248201527f4d696e6957616c6c65743a20617070726f76652066726f6d20746865207a65726044820152686f206164647265737360b81b60648201526084016106bd565b6001600160a01b0384166107a05760405162461bcd60e51b815260206004820152602760248201527f4d696e6957616c6c65743a20617070726f766520746f20746865207a65726f206044820152666164647265737360c81b60648201526084016106bd565b61015f548311156108095760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a20617070726f76652067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b341561081757610817611947565b6001600160a01b038181166000818152610162602090815260408083209489168084529482529182902087905590518681527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6108896000336113f3565b6108a55760405162461bcd60e51b81526004016106bd90612876565b6108ae81611b3d565b610163805460ff191660ff929092169190911790556040518181527fdd30dc35fb86c568de39420f82e371835e8392fdbf6828c67e685a87f115a910906020015b60405180910390a150565b6109056000336113f3565b6109215760405162461bcd60e51b81526004016106bd90612876565b60005b818110156109de576000838383818110610940576109406128ad565b905060200201602081019061095591906125f6565b905061096f600080516020612d25833981519152826113f3565b6109b35760405162461bcd60e51b81526020600482015260156024820152743932b6b7bb34b733903737b716b7b832b930ba37b960591b60448201526064016106bd565b6109cb600080516020612d2583398151915282611a43565b50806109d6816128d9565b915050610924565b507fd045926746dab8a5acf225487f413b986460165cf50f6052689a2e471198e0598282604051610a109291906128f4565b60405180910390a15050565b610a276000336113f3565b610a435760405162461bcd60e51b81526004016106bd90612876565b60005b81811015610b69576000838383818110610a6257610a626128ad565b9050602002016020810190610a7791906125f6565b9050610a91600080516020612d25833981519152826113f3565b15610ade5760405162461bcd60e51b815260206004820152601960248201527f616c726561647920686173206f70657261746f7220726f6c650000000000000060448201526064016106bd565b6101635460ff16610afc600080516020612d25833981519152611930565b10610b3e5760405162461bcd60e51b8152602060048201526012602482015271746f6f206d616e79206f70657261746f727360701b60448201526064016106bd565b610b56600080516020612d2583398151915282610ccc565b5080610b61816128d9565b915050610a46565b507f4c022f03c292dfa42133bfa9f90bbf55089da679c2df97df205f337c12ab7b7c8282604051610a109291906128f4565b610ba3611af7565b336000908152610161602052604090205481610bbd578091505b80821115610c305760405163993995bb60e01b8152336004820152602481018390526044810182905260806064820152602560848201527f496e73756666696369656e74206c6f636b65642066756e647320746f2077697460a482015264686472617760d81b60c482015260e4016106bd565b6000610c3c8383612940565b336000818152610161602052604080822084905551929350909185156108fc0291869190818181858888f19350505050158015610c7d573d6000803e3d6000fd5b503360008181526101616020908152604091829020548251878152918201527ffb59733a8f0bd43414922fb86c6ffdd090e44935074086318980ca89221acc56910160405180910390a2505050565b600082815260976020526040902060010154610ce781611b94565b610cf18383611b9e565b505050565b6001600160a01b0381163314610d665760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106bd565b610d708282611bc0565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610dbd5760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e06600080516020612d05833981519152546001600160a01b031690565b6001600160a01b031614610e2c5760405162461bcd60e51b81526004016106bd906129a3565b610e3581611be2565b60408051600080825260208201909252610e5191839190611c0c565b50565b610e6c600080516020612d25833981519152336113f3565b610e885760405162461bcd60e51b81526004016106bd906129ef565b610e90611af7565b6001600160a01b0382811660009081526101616020908152604080832054610162835281842094861684529390915290205484610f3d57604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152601a60c48201527f53656e6420616d6f756e742063616e6e6f7420657175616c203000000000000060e4820152610104016106bd565b81851115610fc657604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602160c48201527f496e73756666696369656e74206c6f636b65642066756e647320746f2073656e60e4820152601960fa1b610104820152610124016106bd565b8085111561105157604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602360c48201527f496e73756666696369656e7420617070726f7665642066756e647320746f207360e482015262195b9960ea1b610104820152610124016106bd565b600061105d8684612940565b6001600160a01b0386166000908152610161602052604081208290559091506110868784612940565b6001600160a01b03808816600090815261016260209081526040808320938a168084529390915280822084905551929350909189156108fc02918a9190818181858888f193505050501580156110e0573d6000803e3d6000fd5b5060408051888152602081018490529081018290526001600160a01b0380871691908816907f097db31093a1dfbc4fca0de24d2ea0d787b2de44c5fce71552714981745334e29060600160405180910390a350505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156111845760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111cd600080516020612d05833981519152546001600160a01b031690565b6001600160a01b0316146111f35760405162461bcd60e51b81526004016106bd906129a3565b6111fc82611be2565b610d7082826001611c0c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112a85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106bd565b50600080516020612d0583398151915290565b6112c66000336113f3565b6112e25760405162461bcd60e51b81526004016106bd90612876565b336001600160a01b03821614156113325760405162461bcd60e51b815260206004820152601460248201527331b0b73737ba103932b737bab731b29039b2b63360611b60448201526064016106bd565b61133d600082610ccc565b610e51600033610cf6565b6113536000336113f3565b61136f5760405162461bcd60e51b81526004016106bd90612876565b6106ce611d86565b6113826000336113f3565b61139e5760405162461bcd60e51b81526004016106bd90612876565b61015f8190556040518181527fec0d2c2f3a2fec7d9ce81f6f984ece08f0cdf867116717553c179253c65dca00906020016108ef565b600082815260c9602052604081206113ec9083611dbf565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6114296000336113f3565b6114455760405162461bcd60e51b81526004016106bd90612876565b6101608190556040518181527f0595560a63185cdb6922ec5f6b5279ada789aeea2ab360c554dfc94c0b19cc30906020016108ef565b600054610100900460ff161580801561149b5750600054600160ff909116105b806114b55750303b1580156114b5575060005460ff166001145b6115185760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106bd565b6000805460ff19166001179055801561153b576000805461ff0019166101001790555b337fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610381905561156b600082611dcb565b6115957f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e333611b9e565b610163805460ff191660ff891617905560005b858110156115fb576115e9600080516020612d258339815191528888848181106115d4576115d46128ad565b905060200201602081019061036491906125f6565b806115f3816128d9565b9150506115a8565b505061016083905561015f829055801561164f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61166f600080516020612d25833981519152336113f3565b61168b5760405162461bcd60e51b81526004016106bd906129ef565b611693611af7565b60008560038111156116a7576116a7612a30565b14156117c4576040516323b872dd60e01b81526001600160a01b038381166004830152828116602483015260448201889052600091908516906323b872dd90606401602060405180830381600087803b15801561170357600080fd5b505af1158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173b9190612a46565b9050801561179957816001600160a01b0316836001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db388989898960405161178c9493929190612a8a565b60405180910390a36117be565b8686868686866040516332ee88b960e11b81526004016106bd96959493929190612abe565b5061164f565b60018560038111156117d8576117d8612a30565b141561189f57604051632142170760e11b81526001600160a01b0383811660048301528281166024830152604482018690528416906342842e0e906064015b600060405180830381600087803b15801561183157600080fd5b505af1158015611845573d6000803e3d6000fd5b50505050806001600160a01b0316826001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db38888888886040516118929493929190612a8a565b60405180910390a361164f565b60028560038111156118b3576118b3612a30565b141561190b57604051637921219560e11b81526001600160a01b0383811660048301528281166024830152604482018690526064820188905260a06084830152600060a483015284169063f242432a9060c401611817565b8585858585856040516332ee88b960e11b81526004016106bd96959493929190612b2d565b600081815260c96020526040812061069090611dd5565b61194f611af7565b61016054336000908152610161602052604090205461196f903490612b97565b11156119d35760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a206465706f7369742067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b3360009081526101616020526040812080543492906119f3908490612b97565b90915550503360008181526101616020908152604091829020548251348152918201527f61bb8b82654398e0bdd4e0d489b5e9104b6840211fd89f7264264c96589051fd910160405180910390a2565b600082815260976020526040902060010154611a5e81611b94565b610cf18383611bc0565b60006001600160e01b03198216637965db0b60e01b148061069057506301ffc9a760e01b6001600160e01b0319831614610690565b611aa5611af7565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ada3390565b6040516001600160a01b03909116815260200160405180910390a1565b60335460ff16156106ce5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106bd565b60006101008210611b905760405162461bcd60e51b815260206004820152601c60248201527f76616c756520646f6573206e6f742066697420696e203820626974730000000060448201526064016106bd565b5090565b610e518133611ddf565b611ba88282611e43565b600082815260c960205260409020610cf19082611ec9565b611bca8282611ede565b600082815260c960205260409020610cf19082611f45565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610d7081611b94565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c3f57610cf183611f5a565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7857600080fd5b505afa925050508015611ca8575060408051601f3d908101601f19168201909252611ca591810190612baf565b60015b611d0b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016106bd565b600080516020612d058339815191528114611d7a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016106bd565b50610cf1838383611ff6565b611d8e612021565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611ada565b60006113ec838361206a565b610d708282611b9e565b6000610690825490565b611de982826113f3565b610d7057611e01816001600160a01b03166014612094565b611e0c836020612094565b604051602001611e1d929190612bf4565b60408051601f198184030181529082905262461bcd60e51b82526106bd91600401612c69565b611e4d82826113f3565b610d705760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611e853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113ec836001600160a01b038416612230565b611ee882826113f3565b15610d705760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006113ec836001600160a01b03841661227f565b6001600160a01b0381163b611fc75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016106bd565b600080516020612d0583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611fff83612372565b60008251118061200c5750805b15610cf15761201b83836123b2565b50505050565b60335460ff166106ce5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106bd565b6000826000018281548110612081576120816128ad565b9060005260206000200154905092915050565b606060006120a3836002612c9c565b6120ae906002612b97565b67ffffffffffffffff8111156120c6576120c6612679565b6040519080825280601f01601f1916602001820160405280156120f0576020820181803683370190505b509050600360fc1b8160008151811061210b5761210b6128ad565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061213a5761213a6128ad565b60200101906001600160f81b031916908160001a905350600061215e846002612c9c565b612169906001612b97565b90505b60018111156121e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061219d5761219d6128ad565b1a60f81b8282815181106121b3576121b36128ad565b60200101906001600160f81b031916908160001a90535060049490941c936121da81612cbb565b905061216c565b5083156113ec5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106bd565b600081815260018301602052604081205461227757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610690565b506000610690565b600081815260018301602052604081205480156123685760006122a3600183612940565b85549091506000906122b790600190612940565b905081811461231c5760008660000182815481106122d7576122d76128ad565b90600052602060002001549050808760000184815481106122fa576122fa6128ad565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061232d5761232d612cd2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610690565b6000915050610690565b61237b81611f5a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61241a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016106bd565b600080846001600160a01b0316846040516124359190612ce8565b600060405180830381855af49150503d8060008114612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b509150915061249d8282604051806060016040528060278152602001612d45602791396124a6565b95945050505050565b606083156124b55750816113ec565b8251156124c55782518084602001fd5b8160405162461bcd60e51b81526004016106bd9190612c69565b6000602082840312156124f157600080fd5b81356001600160e01b0319811681146113ec57600080fd5b80356001600160a01b038116811461252057600080fd5b919050565b6000806040838503121561253857600080fd5b61254183612509565b946020939093013593505050565b60006020828403121561256157600080fd5b5035919050565b60008083601f84011261257a57600080fd5b50813567ffffffffffffffff81111561259257600080fd5b6020830191508360208260051b85010111156125ad57600080fd5b9250929050565b600080602083850312156125c757600080fd5b823567ffffffffffffffff8111156125de57600080fd5b6125ea85828601612568565b90969095509350505050565b60006020828403121561260857600080fd5b6113ec82612509565b6000806040838503121561262457600080fd5b8235915061263460208401612509565b90509250929050565b60008060006060848603121561265257600080fd5b8335925061266260208501612509565b915061267060408501612509565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156126a257600080fd5b6126ab83612509565b9150602083013567ffffffffffffffff808211156126c857600080fd5b818501915085601f8301126126dc57600080fd5b8135818111156126ee576126ee612679565b604051601f8201601f19908116603f0116810190838211818310171561271657612716612679565b8160405282815288602084870101111561272f57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561276457600080fd5b50508035926020909101359150565b60008060008060006080868803121561278b57600080fd5b853560ff8116811461279c57600080fd5b9450602086013567ffffffffffffffff8111156127b857600080fd5b6127c488828901612568565b9699909850959660408101359660609091013595509350505050565b60008060008060008060c087890312156127f957600080fd5b8635955060208701356004811061280f57600080fd5b94506040870135935061282460608801612509565b925061283260808801612509565b915061284060a08801612509565b90509295509295509295565b6000806040838503121561285f57600080fd5b61286883612509565b915061263460208401612509565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156128ed576128ed6128c3565b5060010190565b60208082528181018390526000908460408401835b86811015612935576001600160a01b0361292284612509565b1682529183019190830190600101612909565b509695505050505050565b600082821015612952576129526128c3565b500390565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526021908201527f73656e64657220646f65736e27742068617665206f70657261746f7220726f6c6040820152606560f81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215612a5857600080fd5b815180151581146113ec57600080fd5b60048110612a8657634e487b7160e01b600052602160045260246000fd5b9052565b84815260808101612a9e6020830186612a68565b60408201939093526001600160a01b039190911660609091015292915050565b868152612ace6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c08201819052601690820152754552433230207472616e73666572206661696c75726560501b6101008201526101200192915050565b868152612b3d6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c0820181905260119082015270496e76616c696420746f6b656e5479706560781b6101008201526101200192915050565b60008219821115612baa57612baa6128c3565b500190565b600060208284031215612bc157600080fd5b5051919050565b60005b83811015612be3578181015183820152602001612bcb565b8381111561201b5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612c2c816017850160208801612bc8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612c5d816028840160208801612bc8565b01602801949350505050565b6020815260008251806020840152612c88816040850160208701612bc8565b601f01601f19169190910160400192915050565b6000816000190483118215151615612cb657612cb66128c3565b500290565b600081612cca57612cca6128c3565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251612cfa818460208701612bc8565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e7d68946286ca3eb2289bc1ca1dca49ddf75e44f75d01b4f93482f683a7f846264736f6c63430008090033", - "deployedBytecode": "0x6080604052600436106101f95760003560e01c80635e1fab0f1161010d578063bcca7b1d116100a0578063dd62ed3e1161006f578063dd62ed3e1461058a578063e24814d6146105d1578063e2b0df8f146105fe578063f5b541a614610615578063f72c0d8b1461063757600080fd5b8063bcca7b1d14610522578063ca15c87314610542578063d0e30db014610562578063d547741f1461056a57600080fd5b806391d14854116100dc57806391d14854146104ad578063a19ba036146104cd578063a217fddf146104ed578063b4d89a071461050257600080fd5b80635e1fab0f1461042057806378226fe71461044057806379c0fb6e146104555780639010d07c1461047557600080fd5b80632e1a7d4d116101905780633d0594d41161015f5780633d0594d4146103a95780634f1ef286146103c957806352d1902d146103dc578063562c2d1d146103f15780635c975abb1461040857600080fd5b80632e1a7d4d146103295780632f2ff15d1461034957806336568abe146103695780633659cfe61461038957600080fd5b80631322a2a5116101cc5780631322a2a51461027d578063248a9ca31461029d57806326224c64146102db5780632752a46e1461030957600080fd5b806301ffc9a7146101fe5780630227c93614610233578063095ea7b31461024a5780630c8a263c1461025d575b600080fd5b34801561020a57600080fd5b5061021e6102193660046124df565b61066b565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b50610248610696565b005b61021e610258366004612525565b6106d0565b34801561026957600080fd5b5061024861027836600461254f565b61087e565b34801561028957600080fd5b506102486102983660046125b4565b6108fa565b3480156102a957600080fd5b506102cd6102b836600461254f565b60009081526097602052604090206001015490565b60405190815260200161022a565b3480156102e757600080fd5b506102cd6102f63660046125f6565b6101616020526000908152604090205481565b34801561031557600080fd5b506102486103243660046125b4565b610a1c565b34801561033557600080fd5b5061024861034436600461254f565b610b9b565b34801561035557600080fd5b50610248610364366004612611565b610ccc565b34801561037557600080fd5b50610248610384366004612611565b610cf6565b34801561039557600080fd5b506102486103a43660046125f6565b610d74565b3480156103b557600080fd5b506102486103c436600461263d565b610e54565b6102486103d736600461268f565b61113b565b3480156103e857600080fd5b506102cd611208565b3480156103fd57600080fd5b506102cd61015f5481565b34801561041457600080fd5b5060335460ff1661021e565b34801561042c57600080fd5b5061024861043b3660046125f6565b6112bb565b34801561044c57600080fd5b50610248611348565b34801561046157600080fd5b5061024861047036600461254f565b611377565b34801561048157600080fd5b50610495610490366004612751565b6113d4565b6040516001600160a01b03909116815260200161022a565b3480156104b957600080fd5b5061021e6104c8366004612611565b6113f3565b3480156104d957600080fd5b506102486104e836600461254f565b61141e565b3480156104f957600080fd5b506102cd600081565b34801561050e57600080fd5b5061024861051d366004612773565b61147b565b34801561052e57600080fd5b5061024861053d3660046127e0565b611657565b34801561054e57600080fd5b506102cd61055d36600461254f565b611930565b610248611947565b34801561057657600080fd5b50610248610585366004612611565b611a43565b34801561059657600080fd5b506102cd6105a536600461284c565b6001600160a01b0391821660009081526101626020908152604080832093909416825291909152205490565b3480156105dd57600080fd5b50610163546105ec9060ff1681565b60405160ff909116815260200161022a565b34801561060a57600080fd5b506102cd6101605481565b34801561062157600080fd5b506102cd600080516020612d2583398151915281565b34801561064357600080fd5b506102cd7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e381565b60006001600160e01b03198216635a05180f60e01b1480610690575061069082611a68565b92915050565b6106a16000336113f3565b6106c65760405162461bcd60e51b81526004016106bd90612876565b60405180910390fd5b6106ce611a9d565b565b60006106da611af7565b338061073a5760405162461bcd60e51b815260206004820152602960248201527f4d696e6957616c6c65743a20617070726f76652066726f6d20746865207a65726044820152686f206164647265737360b81b60648201526084016106bd565b6001600160a01b0384166107a05760405162461bcd60e51b815260206004820152602760248201527f4d696e6957616c6c65743a20617070726f766520746f20746865207a65726f206044820152666164647265737360c81b60648201526084016106bd565b61015f548311156108095760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a20617070726f76652067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b341561081757610817611947565b6001600160a01b038181166000818152610162602090815260408083209489168084529482529182902087905590518681527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6108896000336113f3565b6108a55760405162461bcd60e51b81526004016106bd90612876565b6108ae81611b3d565b610163805460ff191660ff929092169190911790556040518181527fdd30dc35fb86c568de39420f82e371835e8392fdbf6828c67e685a87f115a910906020015b60405180910390a150565b6109056000336113f3565b6109215760405162461bcd60e51b81526004016106bd90612876565b60005b818110156109de576000838383818110610940576109406128ad565b905060200201602081019061095591906125f6565b905061096f600080516020612d25833981519152826113f3565b6109b35760405162461bcd60e51b81526020600482015260156024820152743932b6b7bb34b733903737b716b7b832b930ba37b960591b60448201526064016106bd565b6109cb600080516020612d2583398151915282611a43565b50806109d6816128d9565b915050610924565b507fd045926746dab8a5acf225487f413b986460165cf50f6052689a2e471198e0598282604051610a109291906128f4565b60405180910390a15050565b610a276000336113f3565b610a435760405162461bcd60e51b81526004016106bd90612876565b60005b81811015610b69576000838383818110610a6257610a626128ad565b9050602002016020810190610a7791906125f6565b9050610a91600080516020612d25833981519152826113f3565b15610ade5760405162461bcd60e51b815260206004820152601960248201527f616c726561647920686173206f70657261746f7220726f6c650000000000000060448201526064016106bd565b6101635460ff16610afc600080516020612d25833981519152611930565b10610b3e5760405162461bcd60e51b8152602060048201526012602482015271746f6f206d616e79206f70657261746f727360701b60448201526064016106bd565b610b56600080516020612d2583398151915282610ccc565b5080610b61816128d9565b915050610a46565b507f4c022f03c292dfa42133bfa9f90bbf55089da679c2df97df205f337c12ab7b7c8282604051610a109291906128f4565b610ba3611af7565b336000908152610161602052604090205481610bbd578091505b80821115610c305760405163993995bb60e01b8152336004820152602481018390526044810182905260806064820152602560848201527f496e73756666696369656e74206c6f636b65642066756e647320746f2077697460a482015264686472617760d81b60c482015260e4016106bd565b6000610c3c8383612940565b336000818152610161602052604080822084905551929350909185156108fc0291869190818181858888f19350505050158015610c7d573d6000803e3d6000fd5b503360008181526101616020908152604091829020548251878152918201527ffb59733a8f0bd43414922fb86c6ffdd090e44935074086318980ca89221acc56910160405180910390a2505050565b600082815260976020526040902060010154610ce781611b94565b610cf18383611b9e565b505050565b6001600160a01b0381163314610d665760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016106bd565b610d708282611bc0565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610dbd5760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e06600080516020612d05833981519152546001600160a01b031690565b6001600160a01b031614610e2c5760405162461bcd60e51b81526004016106bd906129a3565b610e3581611be2565b60408051600080825260208201909252610e5191839190611c0c565b50565b610e6c600080516020612d25833981519152336113f3565b610e885760405162461bcd60e51b81526004016106bd906129ef565b610e90611af7565b6001600160a01b0382811660009081526101616020908152604080832054610162835281842094861684529390915290205484610f3d57604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152601a60c48201527f53656e6420616d6f756e742063616e6e6f7420657175616c203000000000000060e4820152610104016106bd565b81851115610fc657604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602160c48201527f496e73756666696369656e74206c6f636b65642066756e647320746f2073656e60e4820152601960fa1b610104820152610124016106bd565b8085111561105157604051630e05486f60e41b81526001600160a01b0380861660048301528416602482015260448101869052606481018390526084810182905260c060a4820152602360c48201527f496e73756666696369656e7420617070726f7665642066756e647320746f207360e482015262195b9960ea1b610104820152610124016106bd565b600061105d8684612940565b6001600160a01b0386166000908152610161602052604081208290559091506110868784612940565b6001600160a01b03808816600090815261016260209081526040808320938a168084529390915280822084905551929350909189156108fc02918a9190818181858888f193505050501580156110e0573d6000803e3d6000fd5b5060408051888152602081018490529081018290526001600160a01b0380871691908816907f097db31093a1dfbc4fca0de24d2ea0d787b2de44c5fce71552714981745334e29060600160405180910390a350505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156111845760405162461bcd60e51b81526004016106bd90612957565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166111cd600080516020612d05833981519152546001600160a01b031690565b6001600160a01b0316146111f35760405162461bcd60e51b81526004016106bd906129a3565b6111fc82611be2565b610d7082826001611c0c565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112a85760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016106bd565b50600080516020612d0583398151915290565b6112c66000336113f3565b6112e25760405162461bcd60e51b81526004016106bd90612876565b336001600160a01b03821614156113325760405162461bcd60e51b815260206004820152601460248201527331b0b73737ba103932b737bab731b29039b2b63360611b60448201526064016106bd565b61133d600082610ccc565b610e51600033610cf6565b6113536000336113f3565b61136f5760405162461bcd60e51b81526004016106bd90612876565b6106ce611d86565b6113826000336113f3565b61139e5760405162461bcd60e51b81526004016106bd90612876565b61015f8190556040518181527fec0d2c2f3a2fec7d9ce81f6f984ece08f0cdf867116717553c179253c65dca00906020016108ef565b600082815260c9602052604081206113ec9083611dbf565b9392505050565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6114296000336113f3565b6114455760405162461bcd60e51b81526004016106bd90612876565b6101608190556040518181527f0595560a63185cdb6922ec5f6b5279ada789aeea2ab360c554dfc94c0b19cc30906020016108ef565b600054610100900460ff161580801561149b5750600054600160ff909116105b806114b55750303b1580156114b5575060005460ff166001145b6115185760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016106bd565b6000805460ff19166001179055801561153b576000805461ff0019166101001790555b337fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610381905561156b600082611dcb565b6115957f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e333611b9e565b610163805460ff191660ff891617905560005b858110156115fb576115e9600080516020612d258339815191528888848181106115d4576115d46128ad565b905060200201602081019061036491906125f6565b806115f3816128d9565b9150506115a8565b505061016083905561015f829055801561164f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b61166f600080516020612d25833981519152336113f3565b61168b5760405162461bcd60e51b81526004016106bd906129ef565b611693611af7565b60008560038111156116a7576116a7612a30565b14156117c4576040516323b872dd60e01b81526001600160a01b038381166004830152828116602483015260448201889052600091908516906323b872dd90606401602060405180830381600087803b15801561170357600080fd5b505af1158015611717573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173b9190612a46565b9050801561179957816001600160a01b0316836001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db388989898960405161178c9493929190612a8a565b60405180910390a36117be565b8686868686866040516332ee88b960e11b81526004016106bd96959493929190612abe565b5061164f565b60018560038111156117d8576117d8612a30565b141561189f57604051632142170760e11b81526001600160a01b0383811660048301528281166024830152604482018690528416906342842e0e906064015b600060405180830381600087803b15801561183157600080fd5b505af1158015611845573d6000803e3d6000fd5b50505050806001600160a01b0316826001600160a01b03167ff63704c7d7c4d784274859e7e55c97f42913ac076b3a2efcb8c56a042f78db38888888886040516118929493929190612a8a565b60405180910390a361164f565b60028560038111156118b3576118b3612a30565b141561190b57604051637921219560e11b81526001600160a01b0383811660048301528281166024830152604482018690526064820188905260a06084830152600060a483015284169063f242432a9060c401611817565b8585858585856040516332ee88b960e11b81526004016106bd96959493929190612b2d565b600081815260c96020526040812061069090611dd5565b61194f611af7565b61016054336000908152610161602052604090205461196f903490612b97565b11156119d35760405162461bcd60e51b815260206004820152602d60248201527f4d696e6957616c6c65743a206465706f7369742067726561746572207468616e60448201526c0819db1bd8985b081b1a5b5a5d609a1b60648201526084016106bd565b3360009081526101616020526040812080543492906119f3908490612b97565b90915550503360008181526101616020908152604091829020548251348152918201527f61bb8b82654398e0bdd4e0d489b5e9104b6840211fd89f7264264c96589051fd910160405180910390a2565b600082815260976020526040902060010154611a5e81611b94565b610cf18383611bc0565b60006001600160e01b03198216637965db0b60e01b148061069057506301ffc9a760e01b6001600160e01b0319831614610690565b611aa5611af7565b6033805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611ada3390565b6040516001600160a01b03909116815260200160405180910390a1565b60335460ff16156106ce5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016106bd565b60006101008210611b905760405162461bcd60e51b815260206004820152601c60248201527f76616c756520646f6573206e6f742066697420696e203820626974730000000060448201526064016106bd565b5090565b610e518133611ddf565b611ba88282611e43565b600082815260c960205260409020610cf19082611ec9565b611bca8282611ede565b600082815260c960205260409020610cf19082611f45565b7f189ab7a9244df0848122154315af71fe140f3db0fe014031783b0946b8c9d2e3610d7081611b94565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff1615611c3f57610cf183611f5a565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c7857600080fd5b505afa925050508015611ca8575060408051601f3d908101601f19168201909252611ca591810190612baf565b60015b611d0b5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016106bd565b600080516020612d058339815191528114611d7a5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016106bd565b50610cf1838383611ff6565b611d8e612021565b6033805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33611ada565b60006113ec838361206a565b610d708282611b9e565b6000610690825490565b611de982826113f3565b610d7057611e01816001600160a01b03166014612094565b611e0c836020612094565b604051602001611e1d929190612bf4565b60408051601f198184030181529082905262461bcd60e51b82526106bd91600401612c69565b611e4d82826113f3565b610d705760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611e853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006113ec836001600160a01b038416612230565b611ee882826113f3565b15610d705760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006113ec836001600160a01b03841661227f565b6001600160a01b0381163b611fc75760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016106bd565b600080516020612d0583398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611fff83612372565b60008251118061200c5750805b15610cf15761201b83836123b2565b50505050565b60335460ff166106ce5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016106bd565b6000826000018281548110612081576120816128ad565b9060005260206000200154905092915050565b606060006120a3836002612c9c565b6120ae906002612b97565b67ffffffffffffffff8111156120c6576120c6612679565b6040519080825280601f01601f1916602001820160405280156120f0576020820181803683370190505b509050600360fc1b8160008151811061210b5761210b6128ad565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061213a5761213a6128ad565b60200101906001600160f81b031916908160001a905350600061215e846002612c9c565b612169906001612b97565b90505b60018111156121e1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061219d5761219d6128ad565b1a60f81b8282815181106121b3576121b36128ad565b60200101906001600160f81b031916908160001a90535060049490941c936121da81612cbb565b905061216c565b5083156113ec5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106bd565b600081815260018301602052604081205461227757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610690565b506000610690565b600081815260018301602052604081205480156123685760006122a3600183612940565b85549091506000906122b790600190612940565b905081811461231c5760008660000182815481106122d7576122d76128ad565b90600052602060002001549050808760000184815481106122fa576122fa6128ad565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061232d5761232d612cd2565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610690565b6000915050610690565b61237b81611f5a565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b61241a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016106bd565b600080846001600160a01b0316846040516124359190612ce8565b600060405180830381855af49150503d8060008114612470576040519150601f19603f3d011682016040523d82523d6000602084013e612475565b606091505b509150915061249d8282604051806060016040528060278152602001612d45602791396124a6565b95945050505050565b606083156124b55750816113ec565b8251156124c55782518084602001fd5b8160405162461bcd60e51b81526004016106bd9190612c69565b6000602082840312156124f157600080fd5b81356001600160e01b0319811681146113ec57600080fd5b80356001600160a01b038116811461252057600080fd5b919050565b6000806040838503121561253857600080fd5b61254183612509565b946020939093013593505050565b60006020828403121561256157600080fd5b5035919050565b60008083601f84011261257a57600080fd5b50813567ffffffffffffffff81111561259257600080fd5b6020830191508360208260051b85010111156125ad57600080fd5b9250929050565b600080602083850312156125c757600080fd5b823567ffffffffffffffff8111156125de57600080fd5b6125ea85828601612568565b90969095509350505050565b60006020828403121561260857600080fd5b6113ec82612509565b6000806040838503121561262457600080fd5b8235915061263460208401612509565b90509250929050565b60008060006060848603121561265257600080fd5b8335925061266260208501612509565b915061267060408501612509565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156126a257600080fd5b6126ab83612509565b9150602083013567ffffffffffffffff808211156126c857600080fd5b818501915085601f8301126126dc57600080fd5b8135818111156126ee576126ee612679565b604051601f8201601f19908116603f0116810190838211818310171561271657612716612679565b8160405282815288602084870101111561272f57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b6000806040838503121561276457600080fd5b50508035926020909101359150565b60008060008060006080868803121561278b57600080fd5b853560ff8116811461279c57600080fd5b9450602086013567ffffffffffffffff8111156127b857600080fd5b6127c488828901612568565b9699909850959660408101359660609091013595509350505050565b60008060008060008060c087890312156127f957600080fd5b8635955060208701356004811061280f57600080fd5b94506040870135935061282460608801612509565b925061283260808801612509565b915061284060a08801612509565b90509295509295509295565b6000806040838503121561285f57600080fd5b61286883612509565b915061263460208401612509565b6020808252601e908201527f73656e64657220646f65736e277420686176652061646d696e20726f6c650000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156128ed576128ed6128c3565b5060010190565b60208082528181018390526000908460408401835b86811015612935576001600160a01b0361292284612509565b1682529183019190830190600101612909565b509695505050505050565b600082821015612952576129526128c3565b500390565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526021908201527f73656e64657220646f65736e27742068617665206f70657261746f7220726f6c6040820152606560f81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215612a5857600080fd5b815180151581146113ec57600080fd5b60048110612a8657634e487b7160e01b600052602160045260246000fd5b9052565b84815260808101612a9e6020830186612a68565b60408201939093526001600160a01b039190911660609091015292915050565b868152612ace6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c08201819052601690820152754552433230207472616e73666572206661696c75726560501b6101008201526101200192915050565b868152612b3d6020820187612a68565b60408101949094526001600160a01b03928316606085015290821660808401521660a082015260e060c0820181905260119082015270496e76616c696420746f6b656e5479706560781b6101008201526101200192915050565b60008219821115612baa57612baa6128c3565b500190565b600060208284031215612bc157600080fd5b5051919050565b60005b83811015612be3578181015183820152602001612bcb565b8381111561201b5750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612c2c816017850160208801612bc8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612c5d816028840160208801612bc8565b01602801949350505050565b6020815260008251806020840152612c88816040850160208701612bc8565b601f01601f19169190910160400192915050565b6000816000190483118215151615612cb657612cb66128c3565b500290565b600081612cca57612cca6128c3565b506000190190565b634e487b7160e01b600052603160045260246000fd5b60008251612cfa818460208701612bc8565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e7d68946286ca3eb2289bc1ca1dca49ddf75e44f75d01b4f93482f683a7f846264736f6c63430008090033", - "linkReferences": {}, - "deployedLinkReferences": {} -} +[ + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "SendFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "enum Enums.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "TransferFailed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "WithdrawalFailed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "DepositSuccessful", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newGlobalUserAuthLimit", + "type": "uint256" + } + ], + "name": "GlobalUserAuthLimitChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newGlobalUserLimit", + "type": "uint256" + } + ], + "name": "GlobalUserLimitChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newThreshold", + "type": "uint256" + } + ], + "name": "OperatorThresholdChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "operators", + "type": "address[]" + } + ], + "name": "OperatorsAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address[]", + "name": "operators", + "type": "address[]" + } + ], + "name": "OperatorsRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "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": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newAllowance", + "type": "uint256" + } + ], + "name": "SendSuccessful", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum Enums.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "TransferSuccessful", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "name": "WithdrawalSuccessful", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "OPERATOR_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "UPGRADER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "operatorAddresses", + "type": "address[]" + } + ], + "name": "adminAddOperators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newGlobalUserAuthLimit", + "type": "uint256" + } + ], + "name": "adminChangeGlobalUserAuthLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newGlobalUserLimit", + "type": "uint256" + } + ], + "name": "adminChangeGlobalUserLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newThreshold", + "type": "uint256" + } + ], + "name": "adminChangeOperatorThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "adminPauseMiniWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "operatorAddresses", + "type": "address[]" + } + ], + "name": "adminRemoveOperators", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "adminUnpauseMiniWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "globalUserAuthLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "globalUserLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "initialOperatorThreshold", + "type": "uint8" + }, + { + "internalType": "address[]", + "name": "initialOperators", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "globalUserLimit_", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "globalUserAuthLimit_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "operatorThreshold", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proxiableUUID", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "renounceAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "send", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "enum Enums.TokenType", + "name": "tokenType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/miniserver/blockchain.js b/miniserver/blockchain.js index ce2b85f..8411134 100644 --- a/miniserver/blockchain.js +++ b/miniserver/blockchain.js @@ -25,7 +25,7 @@ const init = async () => { Logger.log('Initializing blockchain for server') Logger.log(`network=${config.defaultNetwork}, ${JSON.stringify(networkConfig)}`) provider = ethers.getDefaultProvider(networkConfig.url) - miniWallet = new ethers.Contract(networkConfig.miniWalletAddress, MiniWallet.abi, provider) + miniWallet = new ethers.Contract(networkConfig.miniWalletAddress, MiniWallet, provider) provider.pollingInterval = config.pollingInterval signers.splice(0, signers.length) if (networkConfig.mnemonic) { @@ -79,7 +79,7 @@ const prepareExecute = (logger = Logger.log, abortUnlessRPCError = true) => asyn const miniWalletSigner = miniWallet.connect(signers[fromIndex]) logger(`Sampled [${fromIndex}] ${from}`) const latestNonce = await rpc.getNonce({ address: from, network: config.defaultNetwork }) - const gasPrice = await rpc.gasPrice({ network: config.defaultNetwork }) + const gasPrice = await provider.getGasPrice() const snapshotPendingNonces = pendingNonces[from] const nonce = latestNonce + snapshotPendingNonces pendingNonces[from] += 1 @@ -92,7 +92,7 @@ const prepareExecute = (logger = Logger.log, abortUnlessRPCError = true) => asyn const tx = await backOff( async () => miniWalletSigner[method](...params, { nonce, - gasPrice: ethers.BigNumber.from(gasPrice).mul((numAttempts || 0) + 1), + gasPrice: gasPrice.mul((numAttempts || 0) + 1), value: 0, }), { retry: (ex, n) => { diff --git a/miniwallet/contracts/mocks/TestERC1155.sol b/miniwallet/contracts/mocks/TestERC1155.sol index 0d88711..5f31db8 100644 --- a/miniwallet/contracts/mocks/TestERC1155.sol +++ b/miniwallet/contracts/mocks/TestERC1155.sol @@ -54,13 +54,4 @@ contract TestERC1155 is ERC1155, AccessControl { return (ERC1155.supportsInterface(interfaceId) || AccessControl.supportsInterface(interfaceId)); } - - // function supportsInterface(bytes4 interfaceId) - // public - // view - // override(ERC1155, AccessControl) - // returns (bool) - // { - // return super.supportsInterface(interfaceId); - // } } diff --git a/miniwallet/hardhat.config.ts b/miniwallet/hardhat.config.ts index d300e47..7cf83ab 100644 --- a/miniwallet/hardhat.config.ts +++ b/miniwallet/hardhat.config.ts @@ -150,12 +150,13 @@ const hardhatUserconfig: HardhatUserConfig = { freshOutput: true }, abiExporter: { - path: './data/abi', + path: '../miniserver/abi', runOnCompile: true, clear: true, flat: true, - spacing: 2, - pretty: true + only: [':MiniWallet$', ':MiniProxy$'], + format: 'json', + spacing: 2 }, spdxLicenseIdentifier: { overwrite: true, diff --git a/miniwallet/test/utilities/index.ts b/miniwallet/test/utilities/index.ts index 37644a5..02afb39 100644 --- a/miniwallet/test/utilities/index.ts +++ b/miniwallet/test/utilities/index.ts @@ -3,10 +3,6 @@ import { expect } from 'chai' import { MockProvider } from 'ethereum-waffle' import { Contract, BigNumber } from 'ethers' import { ethers } from 'hardhat' -// TODO Parameterize CallData -const ContractPath = '../../build/contracts/miniWallet/miniWallet.sol/MiniWallet.json' -const ContractJSON = require(ContractPath) -const { abi } = ContractJSON export const BASE_TEN = 10 @@ -38,8 +34,7 @@ export async function deployUpgradeable (testEnvironment, contracts) { for (const contract of contracts) { const implementation = await contract[1].deploy() await implementation.deployed() - const iface = new ethers.utils.Interface(abi) - const calldata = iface.encodeFunctionData('initialize', contract[2] || []) + const calldata = contract[1].interface.encodeFunctionData('initialize', contract[2] || []) const proxy = await testEnvironment.MiniProxy.deploy(implementation.address, calldata) await proxy.deployed() testEnvironment[contract[0]] = testEnvironment.MiniWallet.attach(proxy.address) diff --git a/miniwallet/tsconfig.json b/miniwallet/tsconfig.json index 8d7c8d5..c0828c0 100644 --- a/miniwallet/tsconfig.json +++ b/miniwallet/tsconfig.json @@ -9,6 +9,6 @@ "resolveJsonModule": true, "noImplicitAny": false }, - "include": ["./scripts", "./test", "./deploy", "./typechain", "./hardhat.config.ts"], + "include": ["./scripts", "./test", "./deploy", "./typechain", "./hardhat.config.ts", "test/utilities/constants.ts"], "files": ["./hardhat.config.ts"] } From b0267e6bfb2c5270fac45bfcbd9d27f2e48ae506 Mon Sep 17 00:00:00 2001 From: John Whitton Date: Thu, 22 Sep 2022 11:39:18 -0700 Subject: [PATCH 09/12] Remove dummy URI's in Mock Contracts --- miniwallet/contracts/mocks/TestERC1155.sol | 2 +- miniwallet/contracts/mocks/TestERC721.sol | 2 +- miniwallet/devlog/FEATURE_ROLLOUT.md | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/miniwallet/contracts/mocks/TestERC1155.sol b/miniwallet/contracts/mocks/TestERC1155.sol index 5f31db8..a85c3c9 100644 --- a/miniwallet/contracts/mocks/TestERC1155.sol +++ b/miniwallet/contracts/mocks/TestERC1155.sol @@ -11,7 +11,7 @@ contract TestERC1155 is ERC1155, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); constructor(uint256[] memory tokenIds, uint256[] memory amounts) - ERC1155("ipfs://testerc1155.modulo.so/") + ERC1155("") { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); _grantRole(URI_SETTER_ROLE, msg.sender); diff --git a/miniwallet/contracts/mocks/TestERC721.sol b/miniwallet/contracts/mocks/TestERC721.sol index 418b4ed..d0620ad 100644 --- a/miniwallet/contracts/mocks/TestERC721.sol +++ b/miniwallet/contracts/mocks/TestERC721.sol @@ -22,7 +22,7 @@ contract TestERC721 is ERC721, AccessControl { } function _baseURI() internal pure override returns (string memory) { - return "ipfs://testerc721.modulo.so/"; + return ""; } function safeMint(address to) public onlyRole(MINTER_ROLE) { diff --git a/miniwallet/devlog/FEATURE_ROLLOUT.md b/miniwallet/devlog/FEATURE_ROLLOUT.md index deab79a..4287a3c 100644 --- a/miniwallet/devlog/FEATURE_ROLLOUT.md +++ b/miniwallet/devlog/FEATURE_ROLLOUT.md @@ -63,18 +63,18 @@ These are ready for merge - Ensure MiniWallet and MiniServer can be validated against ethLocal - Update config so testing and deploy work on hardhat - Improve Proxy based on Feedback and ensure tests use Proxies + - Feeback on PR + - Automatic Population of ABI's for miniserver + - Rewrite of test contracts + - Removal of dummy URL's in test contrcts **Outstanding Items** * Replace Deployment with [native deployment](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/deploy/001_deploy_miniWallet.ts) will allow us to remove the unnecessary population of [ADMIN_SLOT](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/contracts/miniWallet/MiniWallet.sol#L377) * Review MiniProxy.sol to ensure that we are happy with this UUPS compliant Proxy. If we decide to change the Proxy at a later point we will need to update contract addresses in miniserver and potentially other deployments. -* Type 2 Transactions -* Automatic Population of ABI's for miniserver -* Rewrite of test contracts -* **Future Work** -* mulit-call functionality for support of multiple transactions such as authorizations. +* multi-call functionality for support of multiple transactions such as approvals. * Update Contract Testing to test administrative functions and what happens under different scenarios such as miniWallet paused. **Refactor Notes** From 9b66e2e61b45b5042c770adb6b46598b7cc1379e Mon Sep 17 00:00:00 2001 From: John Whitton Date: Fri, 23 Sep 2022 09:32:11 -0700 Subject: [PATCH 10/12] Update Miniserver payment api, so that request comes from user --- miniserver/routes/index.js | 29 +++++++++++++++------------- miniwallet/.env.example | 2 +- miniwallet/devlog/FEATURE_ROLLOUT.md | 12 +++++------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/miniserver/routes/index.js b/miniserver/routes/index.js index ef04934..626fa9c 100644 --- a/miniserver/routes/index.js +++ b/miniserver/routes/index.js @@ -39,47 +39,50 @@ const parseSMS = async (req, res, next) => { res.status(status).send(response.toString()) } try { + let fromAddress const u = await User.findByPhone({ phone: senderPhoneNumber }) - if (!u) { + if (u?.address) { + fromAddress = u.address + } else { return respond('You are not registered. Signup at https://smswallet.xyz') } if (smsParams.length < 1) { return respond('error: empty sms command') } if (smsParams[0] === 'b') { - req.processedBody = { ...req.processedBody, command: 'balance', fromAddress: u.address } + req.processedBody = { ...req.processedBody, command: 'balance', fromAddress } return next() } if (smsParams[0] === 'p') { if (smsParams.length < 2) { - return respond('error: pay request requires funder and an amount. example request "p +14158401999 0.1"') + return respond('error: pay request requires recipient and an amount. example request "p +16505473175 0.1"') } if (!(toNumber(smsParams[2]) > 0)) { - return respond(`error: pay request requires a valid amount': ${smsParams[2]} example request "p +14158401999 0.1"`) + return respond(`error: pay request requires a valid amount': ${smsParams[2]} example request "p +116505473175 0.1"`) } const amount = ethers.utils.parseEther(smsParams[2]) - let funderAddress - // Allow requesting of funds from users by address (without checking registered phone number) + let toAddress + // Allow sending of funds to users by address (without checking registered phone number) if (smsParams[1].substr(0, 2) === '0x') { if (!isValidAddress(smsParams[1])) { - return respond(`error: invalid funder address ${smsParams[1]}. example request "p 0x8ba1f109551bd432803012645ac136ddd64dba72 0.1"`) + return respond(`error: invalid recipient address ${smsParams[1]}. example request "p 0x58bB8c7D2c90dF970fb01a5cD29c4075C41d3FFB 0.1"`) } - funderAddress = checkSumAddress(smsParams[1]) + toAddress = checkSumAddress(smsParams[1]) } else { const { isValid, phoneNumber } = phone(smsParams[1], smsParams[1] === '+' ? undefined : phone(u.phone).countryIso3) if (!isValid) { - return respond(`error: invalid funders phone number ${smsParams[1]}. example request "p +14158401999 0.1"`) + return respond(`error: invalid recipient phone number ${smsParams[1]}. example request "p +16505473175 0.1"`) } const u2 = await User.findByPhone({ phone: phoneNumber }) if (!u2?.address) { - return respond(`error: funders phone number is not a registered wallet: ${smsParams[1]}. example request "p +14158401999 0.1"`) + return respond(`error: recipients phone number is not a registered wallet: ${smsParams[1]}. example request "p +16505473175 0.1"`) } - funderAddress = u2.address + toAddress = u2.address } - req.processedBody = { ...req.processedBody, command: 'pay', fromAddress: funderAddress, toAddress: u.address, amount } + req.processedBody = { ...req.processedBody, command: 'pay', fromAddress, toAddress, amount } return next() } - return respond('error: invalid sms command. example payment request "p +14158401999 0.1"') + return respond('error: invalid sms command. example payment request "p +16505473175 0.1"') } catch (ex) { console.error(ex) return respond('An unexpected occurred. Please contact support.') diff --git a/miniwallet/.env.example b/miniwallet/.env.example index eaaf9ff..fe6667c 100644 --- a/miniwallet/.env.example +++ b/miniwallet/.env.example @@ -22,7 +22,7 @@ MINIWALLET_INITIAL_AUTH_LIMIT=100000 # Smart Contract ethlocal config ## MiniWallet ETH_LOCAL_MINIWALLET_INITIAL_OPERATOR_THRESHOLD=10 -ETH_LOCAL_MINIWALLET_INITIAL_OPERATORS=["0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"] +ETH_LOCAL_MINIWALLET_INITIAL_OPERATORS=["0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","0x70997970C51812dc3A010C7d01b50e0d17dc79C8","0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC","0x90F79bf6EB2c4f870365E785982E1f101E93b906"] ETH_LOCAL_MINIWALLET_INITIAL_USER_LIMIT=1000 ETH_LOCAL_MINIWALLET_INITIAL_AUTH_LIMIT=100 diff --git a/miniwallet/devlog/FEATURE_ROLLOUT.md b/miniwallet/devlog/FEATURE_ROLLOUT.md index 4287a3c..00b3d27 100644 --- a/miniwallet/devlog/FEATURE_ROLLOUT.md +++ b/miniwallet/devlog/FEATURE_ROLLOUT.md @@ -170,10 +170,8 @@ Typically when testing locally you can use the following tools with UI alias ganachem='ganache -m "test test test test test test test test test test test junk"' # twilio aliases -alias tmb='twilio api:core:messages:create --from "+14158401410" --to "+17372327333" --body "b"' -alias tmp='twilio api:core:messages:create --from "+16505473175" --to "+17372327333" --body "p 4158401410 0.1"' -alias tmps='twilio api:core:messages:create --from "+14158401410" --to "+17372327333" --body "p 4158401410 0.1"' -alias tmpbp='twilio api:core:messages:create --from "+14158401410" --to "+17372327333" --body "p 4158401999 0.1"' +alias tmb='twilio api:core:messages:create --from "+14158401410" --to "+1 +alias tmp='twilio api:core:messages:create --from "+14158401410" --to "+17372327333" --body "p 6505473175 0.1"' # one-wallet aliases alias cdo="cd /Users/john/one-wallet; pwd" @@ -296,12 +294,12 @@ Following is an overview of the tests usually done - `yarn deploy ethlocal` : Deploy all the contracts and mint test NFT's - Reset metamask funding account -- Transfer 20 ETH from admin to sms-wallet user `0x143A933E79931006b3Eb89cBc938587546faF159` -- Transfer 20 ETH admin to sms-wallet creator `0x58bB8c7D2c90dF970fb01a5cD29c4075C41d3FFB` +- Transfer 40 ETH from admin to sms-wallet user `0x143A933E79931006b3Eb89cBc938587546faF159` - Transfer 5 ETH fROM user to creator - [user deposits 10 ETH and approves 1 ETH for creator](https://localhost:3100/call?amount=10&callback=aHR0cHM6Ly9sb2NhbGhvc3Q6MzA5OS9jYWxsYmFjaw%3D%3D&calldata=eyJtZXRob2QiOiJhcHByb3ZlKGFkZHJlc3MsdWludDI1NikiLCJwYXJhbWV0ZXJzIjpbeyJuYW1lIjoic3BlbmRlciIsInR5cGUiOiJhZGRyZXNzIiwidmFsdWUiOiIweDU4YkI4YzdEMmM5MGRGOTcwZmIwMWE1Y0QyOWM0MDc1QzQxZDNGRkIifSx7Im5hbWUiOiJhbW91bnQiLCJ0eXBlIjoidWludDI1NiIsInZhbHVlIjoiMTAwMDAwMDAwMDAwMDAwMDAwMCJ9XX0%3D&caller=Token%20Warrior&comment=Fund%20MiniWallet%2010%20ETH%20and%20approve%201%20ETH%20for%20creator%200x58bB8c7D2c90dF970fb01a5cD29c4075C41d3FFB&dest=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512) - `tmb` checks users balance, responses can be viewed in the [twilio monitoring console](https://console.twilio.com/us1/monitor/logs/sms?frameUrl=%2Fconsole%2Fsms%2Flogs%3Fx-target-region%3Dus1¤tFrameUrl=%2Fconsole%2Fsms%2Flogs%3F__override_layout__%3Dembed%26bifrost%3Dtrue%26x-target-region%3Dus1) -- `tmp` creator requests the user to fund the user's mini wallet. The responses can be viewed in the [twilio monitoring console](https://console.twilio.com/us1/monitor/logs/sms?frameUrl=%2Fconsole%2Fsms%2Flogs%3Fx-target-region%3Dus1¤tFrameUrl=%2Fconsole%2Fsms%2Flogs%3F__override_layout__%3Dembed%26bifrost%3Dtrue%26x-target-region%3Dus1) +- `tmp` user sends funds to the creator from the user's mini wallet. The responses can be viewed in the [twilio monitoring console](https://console.twilio.com/us1/monitor/logs/sms?frameUrl=%2Fconsole%2Fsms%2Flogs%3Fx-target-region%3Dus1¤tFrameUrl=%2Fconsole%2Fsms%2Flogs%3F__override_layout__%3Dembed%26bifrost%3Dtrue%26x-target-region%3Dus1) +- Transfer 5 ETH from user to creator using the miniwallet - Add the miniID, mini721 and mini1155 tokens to both the user and creator UI (note: you can use the browser in separate sandboxes, one for the user, and another for the creator) From f2060a7632228bfc2ea9fd03bb54110d4be3c557 Mon Sep 17 00:00:00 2001 From: polymorpher Date: Sat, 24 Sep 2022 00:37:19 -0700 Subject: [PATCH 11/12] fix variable mutability --- miniserver/routes/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/miniserver/routes/index.js b/miniserver/routes/index.js index 626fa9c..cb5262e 100644 --- a/miniserver/routes/index.js +++ b/miniserver/routes/index.js @@ -39,11 +39,8 @@ const parseSMS = async (req, res, next) => { res.status(status).send(response.toString()) } try { - let fromAddress - const u = await User.findByPhone({ phone: senderPhoneNumber }) - if (u?.address) { - fromAddress = u.address - } else { + const { address: fromAddress } = (await User.findByPhone({ phone: senderPhoneNumber })) || {} + if (!fromAddress) { return respond('You are not registered. Signup at https://smswallet.xyz') } if (smsParams.length < 1) { From dc54f9dba4847a03f18103543ab0712266e3ae10 Mon Sep 17 00:00:00 2001 From: polymorpher Date: Sat, 24 Sep 2022 01:00:19 -0700 Subject: [PATCH 12/12] documentation revision --- miniwallet/devlog/FEATURE_ROLLOUT.md | 82 +++++++++++++++------------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/miniwallet/devlog/FEATURE_ROLLOUT.md b/miniwallet/devlog/FEATURE_ROLLOUT.md index 00b3d27..979c2bd 100644 --- a/miniwallet/devlog/FEATURE_ROLLOUT.md +++ b/miniwallet/devlog/FEATURE_ROLLOUT.md @@ -64,18 +64,19 @@ These are ready for merge - Update config so testing and deploy work on hardhat - Improve Proxy based on Feedback and ensure tests use Proxies - Feeback on PR - - Automatic Population of ABI's for miniserver - - Rewrite of test contracts + - Automatic population of contract ABIs for miniserver + - Rewriting test contracts - Removal of dummy URL's in test contrcts **Outstanding Items** * Replace Deployment with [native deployment](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/deploy/001_deploy_miniWallet.ts) will allow us to remove the unnecessary population of [ADMIN_SLOT](https://github.com/polymorpher/sms-wallet/blob/jw-proxy-tmp/miniwallet/contracts/miniWallet/MiniWallet.sol#L377) -* Review MiniProxy.sol to ensure that we are happy with this UUPS compliant Proxy. If we decide to change the Proxy at a later point we will need to update contract addresses in miniserver and potentially other deployments. +* Review MiniProxy.sol to ensure that we are happy with this UUPS compliant proxy. If we decide to change the proxy at a later point we will need to update contract addresses in miniserver and potentially other deployments. **Future Work** -* multi-call functionality for support of multiple transactions such as approvals. -* Update Contract Testing to test administrative functions and what happens under different scenarios such as miniWallet paused. + +* Multi-call functionality for support of multiple transactions such as approvals. +* Update contract testing to include administrative functions and what happens under different scenarios such as miniWallet paused. **Refactor Notes** @@ -90,74 +91,77 @@ git push --set-upstream origin ws-miniwallet-v0 ``` ### mini-wallet deployment and upgrade scripts -These needs some improvement on fine-control over deploy and upgrade process (most likely can't just use simple hardhat calls / plugins anymore) and storing (not just logging) the addresses of proxy, logic, and storage + +There needs to be some improvement over the level of control on the deploy and upgrade processes. Most likely, we will be unable to simply just use hardhat calls or plugins. We should also store the addresses of proxy, logic contract, and storage slots, instead of merely logging them. **Key Features** + - Deterministic Deployments - For Proxy Contracts - LightWeight Persistence of Artifacts - Multichain/MultiContract Deployment Process + **Branch and commits** **Outstanding Items** + * [PROXY Enhancements](https://github.com/polymorpher/sms-wallet/blob/ws-miniwallet-v0/miniwallet/devlog/PROXY.md): Including Deterministic Deployments and Persistence of artifacts. * [Configuration Enhancements](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/CONFIGURATION.md): ability to independently deploy (on multiple chains) and test each work stream. * Parameterizing callData for tests -* Incorporation of one-wallet lib +* Directly generating calldata using abi encoding similar to what is done in one-wallet lib ### mini1155, 721, and related deployment scripts and tests -These need some sanitization and maybe some simplification on tests. They are pretty much ready for merge +There needs to be some sanitization and maybe some simplification on tests. It is ready for merging. **Key Features** -* Operator NFT Collectibles Airdrop: Mini721: These are NFT collections airdropped by Operators to each Registered User. For Initial Phase we will use Minion Images. Attributes (TokenId, Phone, Address, Country) -* User/Creator: Friends and Fans: Minted by MiniID Holders to friends/fans 1 to 1 correlation between MiniID TokenId and Mini1155 TokenId (one can issue multiple Mini1155 tokens of the same token ID to any address). Think of it as a friends list. It could also be event based, i.e. issued by the Owner before an event, and burned afterwards. Metadata attributes may include: IssuerTokenId, IssuerPhone, IssuerAddress, IssuerCountry +* Airdropping NFT Collectibles by the operators using Mini721: these are NFT collections airdropped by Operators to each registered user. For the initial phase we will use minion images, and metadata attributes including tokenId, phone numbers, addresses, and country codes. -* Creator NFT Collections: These are NFT collections (Mini721C) created by Creators (could have its own factory). For Initial Phase we will use Minion Images +* Friends and Fans: these NFTs can be minted by MiniID NFT holders to friends and fans. There is an 1-to-1 correlation between MiniID tokenId and Mini1155 tokenId. A user may issue multiple Mini1155 tokens using the same token ID to any address. The functionality could be thought as a friends list. It may be used in events, where owners may issue these tokens ahead of the event, and burn them afterwards. The metadata attributes of these tokens could include token Id, phone numbers, addresses, and country codes. -* Creator Access Passes: These are NFT Access Passes(Mini1155C) Given by Creators (could have its own factory) +* Creator NFT Collections: these are NFT collections (Mini721C) created by creators, which could have its own smart contract factory. For the initial phase, we will use minion images as the placeholder. + +* Creator Access Passes: these are NFT Access Passes (Mini1155C) sent to users by creators, which could have its own smart contract factory. **Branch and commits** +[TODO: this section is incomplete] + **Outstanding Items** ### miniID related and other WIP stuff -These are incomplete +[TODO: this section is incomplete] **Key Features** + MiniID: Soulbound Token (assigned to a phone number, cannot be transferred), 1 per phone number. * Displayable as a QR Code which encapsulates information including TokenId, Phone, Address, Country. **Branch and commits** +[TODO: this section is incomplete] + **Outstanding Items** * [Signup Flow](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/NFTID.md#sign-up-flow) * [Airdrop Flow](https://github.com/polymorpher/sms-wallet/blob/main/miniwallet/devlog/NFTID.md#airdrop-flow) -* QR Code Generation: +* QR Code Generation for displaying miniID in frontend UI -### documentations (NFTID.md, PROXY.md) - -These need further review and some revision - -**Key Features** - -**Branch and commits** - -**Outstanding Items** +### Documentations (NFTID.md, PROXY.md) +[TODO: this section is incomplete] # Deployment ## Infrastructure -For local testing you can use the following emulators +For local testing, one can use the following emulators * [Twilio](https://console.twilio.com/?frameUrl=%2Fconsole%3Fx-target-region%3Dus1) * [Google Cloud Datastore](https://console.cloud.google.com/datastore/entities;kind=nft_dev;ns=sms-wallet/query/kind?project=sms-wallet-00) -Typically when testing locally you can use the following tools with UI +One could also use the following tools which have frontend UIs. * [Metamask](chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html) : Used to fund the sms-wallets from the admin account deployed with Ganache `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266` * [sms-wallet](https://localhost:3100/): Used for user and creator frontend testing @@ -194,11 +198,11 @@ alias gmu="git checkout master; git fetch upstream; git merge upstream/master; g ``` -## Launching the infrastructure +## Local deployment -If running this locally on a mac you can use a tool like iterm2 with separate windows for each instance. +Tips: tools such as iterm2 could be helpful for creating separate windows for each tool and each test process. -### gancache port:8545 +### gancache, port:8545 ``` cdos @@ -209,9 +213,11 @@ cd miniwallet yarn deploy --network ethlocal ``` -### Reset metamask account and fund wallet +### MetaMask + +You could import testing accounts to MetaMask to manage the funds -### Google DataStore Locally port:9000 +### Google Datastore, port:9000 ``` # https://cloud.google.com/datastore/docs/tools/datastore-emulator#starting_the_emulator @@ -229,7 +235,7 @@ cd /Users/john/.config/gcloud/emulators/datastore rm -rf WEB-INF ``` -### sms-wallet miniserver http port:3101 https port:8444 +### sms-wallet miniserver, http port:3101 https port:8444 ``` cdos @@ -238,7 +244,7 @@ yarn debug ``` -### sms-wallet server http port:3000 https port:8443 +### sms-wallet server, http port:3000 https port:8443 ``` cdos @@ -246,7 +252,7 @@ cd server yarn debug ``` -### sms-wallet client https port: 3100 +### sms-wallet client, https port: 3100 ``` cdos @@ -254,7 +260,7 @@ cd client yarn debug ``` -### sms-wallet demo https: port 3099 +### sms-wallet demo, https: port 3099 ``` cdos @@ -262,14 +268,14 @@ cd demo cd yarn debug ``` -### ngrok allows inbound requests to local sms-server +### ngrok, allows inbound requests to local sms-server ``` cd /Applications ./ngrok http 3101 ``` -### twilio connect incoming messages to local server +### twilio, connect incoming messages to local server ``` cd /Applications @@ -278,7 +284,7 @@ twilio phone-numbers:update +17372327333 --sms-url https://04ac-2601-647-4701-35 ## Testing -Following is an overview of the tests usually done +Here is an overview of the tests usually performed during the development **Smart Contract Testing** @@ -290,7 +296,7 @@ Following is an overview of the tests usually done - Deploy all the local infrastucture [see above] -**End to End Testing** +**End-to-End Testing** - `yarn deploy ethlocal` : Deploy all the contracts and mint test NFT's - Reset metamask funding account