diff --git a/packages/hardhat/deployments/sepolia/.chainId b/packages/hardhat/deployments/sepolia/.chainId deleted file mode 100644 index 1b14418..0000000 --- a/packages/hardhat/deployments/sepolia/.chainId +++ /dev/null @@ -1 +0,0 @@ -11155111 diff --git a/packages/hardhat/deployments/sepolia/Stream.json b/packages/hardhat/deployments/sepolia/Stream.json deleted file mode 100644 index fb578a6..0000000 --- a/packages/hardhat/deployments/sepolia/Stream.json +++ /dev/null @@ -1,1046 +0,0 @@ -{ - "address": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "abi": [ - { - "inputs": [ - { - "internalType": "address[]", - "name": "_initialOwners", - "type": "address[]" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "FailedToSendEther", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientContractFunds", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientStreamFunds", - "type": "error" - }, - { - "inputs": [], - "name": "NoActiveStream", - "type": "error" - }, - { - "inputs": [], - "name": "PreviousAmountNotFullyWithdrawn", - "type": "error" - }, - { - "inputs": [], - "name": "UnauthorizedWithdrawal", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "grantId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "AddGrant", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "addedBy", - "type": "address" - } - ], - "name": "AddOwner", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "grantId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "grantNumber", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "stageNumber", - "type": "uint8" - } - ], - "name": "MoveGrantToNextStage", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "removedOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "removedBy", - "type": "address" - } - ], - "name": "RemoveOwner", - "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": "uint256", - "name": "grantId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "cap", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "last", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amountLeft", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "grantNumber", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "stageNumber", - "type": "uint8" - } - ], - "name": "UpdateGrant", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "grantId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "grantNumber", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "stageNumber", - "type": "uint8" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DUST_THRESHOLD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FULL_STREAM_UNLOCK_PERIOD", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OWNER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_builder", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_cap", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "_grantNumber", - "type": "uint8" - } - ], - "name": "addGrantStream", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "addOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "builderGrants", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_builder", - "type": "address" - } - ], - "name": "getBuilderGrantCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "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": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "grantStreams", - "outputs": [ - { - "internalType": "uint256", - "name": "cap", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "last", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amountLeft", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "grantNumber", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "stageNumber", - "type": "uint8" - }, - { - "internalType": "address", - "name": "builder", - "type": "address" - } - ], - "stateMutability": "view", - "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": "uint256", - "name": "_grantId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_cap", - "type": "uint256" - } - ], - "name": "moveGrantToNextStage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nextGrantId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "removeOwner", - "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": "_grantId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - }, - { - "internalType": "string", - "name": "_reason", - "type": "string" - } - ], - "name": "streamWithdraw", - "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": "_grantId", - "type": "uint256" - } - ], - "name": "unlockedGrantAmount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_grantId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_cap", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_last", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_amountLeft", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "_stageNumber", - "type": "uint8" - } - ], - "name": "updateGrant", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "receipt": { - "to": null, - "from": "0x55b9CB0bCf56057010b9c471e7D42d60e1111EEa", - "contractAddress": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "transactionIndex": 31, - "gasUsed": "1389401", - "logsBloom": "0x0000000400000000080000000000000008008000000000000002000000000000000000000000000000000100000000000000000000000000000000000050000040000000000000000000000000100000000000000000000000000000000000000000000002000c400000020000000800000000000000000000000000000000000000000010000100000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000001000000000000020000000000000000000000000000000000000000000000100000000000020000000001000000000000000000000001000000000000000000000000008002000", - "blockHash": "0xe8eeb9d367a52f8e984cbd69fb1dce4f2f8222d64d218121b1f12d0aae54493f", - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "logs": [ - { - "transactionIndex": 31, - "blockNumber": 6641664, - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "address": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "topics": [ - "0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff", - "0xb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0xb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e" - ], - "data": "0x", - "logIndex": 64, - "blockHash": "0xe8eeb9d367a52f8e984cbd69fb1dce4f2f8222d64d218121b1f12d0aae54493f" - }, - { - "transactionIndex": 31, - "blockNumber": 6641664, - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "address": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e", - "0x00000000000000000000000055b9cb0bcf56057010b9c471e7d42d60e1111eea", - "0x00000000000000000000000055b9cb0bcf56057010b9c471e7d42d60e1111eea" - ], - "data": "0x", - "logIndex": 65, - "blockHash": "0xe8eeb9d367a52f8e984cbd69fb1dce4f2f8222d64d218121b1f12d0aae54493f" - }, - { - "transactionIndex": 31, - "blockNumber": 6641664, - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "address": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e", - "0x00000000000000000000000060583563d5879c2e59973e5718c7de2147971807", - "0x00000000000000000000000055b9cb0bcf56057010b9c471e7d42d60e1111eea" - ], - "data": "0x", - "logIndex": 66, - "blockHash": "0xe8eeb9d367a52f8e984cbd69fb1dce4f2f8222d64d218121b1f12d0aae54493f" - }, - { - "transactionIndex": 31, - "blockNumber": 6641664, - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "address": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e", - "0x000000000000000000000000b8224dfcf3c174331a8e6a841aeea7df321f6d8e", - "0x00000000000000000000000055b9cb0bcf56057010b9c471e7d42d60e1111eea" - ], - "data": "0x", - "logIndex": 67, - "blockHash": "0xe8eeb9d367a52f8e984cbd69fb1dce4f2f8222d64d218121b1f12d0aae54493f" - }, - { - "transactionIndex": 31, - "blockNumber": 6641664, - "transactionHash": "0xbb155808c08414941008c1c8219caf1721f9f495d62e8477ab4d769a9d339ad0", - "address": "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e", - "0x000000000000000000000000b4f53bd85c00ef22946d24ae26bc38ac64f5e7b1", - "0x00000000000000000000000055b9cb0bcf56057010b9c471e7d42d60e1111eea" - ], - "data": "0x", - "logIndex": 68, - "blockHash": "0xe8eeb9d367a52f8e984cbd69fb1dce4f2f8222d64d218121b1f12d0aae54493f" - } - ], - "blockNumber": 6641664, - "cumulativeGasUsed": "6982808", - "status": 1, - "byzantium": true - }, - "args": [ - [ - "0x55b9CB0bCf56057010b9c471e7D42d60e1111EEa", - "0x60583563D5879C2E59973E5718c7DE2147971807", - "0xb8224dfCf3C174331a8e6a841AEEa7dF321f6D8E", - "0xB4F53bd85c00EF22946d24Ae26BC38Ac64F5E7B1" - ] - ], - "numDeployments": 1, - "solcInputHash": "66949c7747c59450b1528b6c03e97e3b", - "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_initialOwners\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FailedToSendEther\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientContractFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientStreamFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoActiveStream\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PreviousAmountNotFullyWithdrawn\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnauthorizedWithdrawal\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"grantId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AddGrant\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addedBy\",\"type\":\"address\"}],\"name\":\"AddOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"grantId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"grantNumber\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"stageNumber\",\"type\":\"uint8\"}],\"name\":\"MoveGrantToNextStage\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"removedBy\",\"type\":\"address\"}],\"name\":\"RemoveOwner\",\"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\":\"uint256\",\"name\":\"grantId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"last\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountLeft\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"grantNumber\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"stageNumber\",\"type\":\"uint8\"}],\"name\":\"UpdateGrant\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"grantId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"grantNumber\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"stageNumber\",\"type\":\"uint8\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DUST_THRESHOLD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FULL_STREAM_UNLOCK_PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"OWNER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_builder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_cap\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"_grantNumber\",\"type\":\"uint8\"}],\"name\":\"addGrantStream\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"addOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"builderGrants\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_builder\",\"type\":\"address\"}],\"name\":\"getBuilderGrantCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"grantStreams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"last\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountLeft\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"grantNumber\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"stageNumber\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"builder\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"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\":\"uint256\",\"name\":\"_grantId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_cap\",\"type\":\"uint256\"}],\"name\":\"moveGrantToNextStage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextGrantId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"removeOwner\",\"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\":\"_grantId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_reason\",\"type\":\"string\"}],\"name\":\"streamWithdraw\",\"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\":\"_grantId\",\"type\":\"uint256\"}],\"name\":\"unlockedGrantAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_grantId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_last\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_amountLeft\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"_stageNumber\",\"type\":\"uint8\"}],\"name\":\"updateGrant\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Stream.sol\":\"Stream\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/Stream.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.0 <0.9.0;\\n\\nimport \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\n\\ncontract Stream is AccessControl {\\n\\tbytes32 public constant OWNER_ROLE = keccak256(\\\"OWNER_ROLE\\\");\\n\\n\\tstruct GrantStream {\\n\\t\\tuint256 cap;\\n\\t\\tuint256 last;\\n\\t\\tuint256 amountLeft;\\n\\t\\tuint8 grantNumber;\\n\\t\\tuint8 stageNumber;\\n\\t\\taddress builder;\\n\\t}\\n\\n\\tmapping(uint256 => GrantStream) public grantStreams;\\n\\tuint256 public nextGrantId = 1;\\n\\n\\tmapping(address => uint256[]) public builderGrants;\\n\\n\\tuint256 public constant FULL_STREAM_UNLOCK_PERIOD = 180; // 30 days\\n\\tuint256 public constant DUST_THRESHOLD = 1000000000000000; // 0.001 ETH\\n\\n\\tevent Withdraw(\\n\\t\\taddress indexed to,\\n\\t\\tuint256 amount,\\n\\t\\tstring reason,\\n\\t\\tuint256 grantId,\\n\\t\\tuint8 grantNumber,\\n\\t\\tuint8 stageNumber\\n\\t);\\n\\tevent AddGrant(uint256 indexed grantId, address indexed to, uint256 amount);\\n\\tevent MoveGrantToNextStage(\\n\\t\\tuint256 indexed grantId,\\n\\t\\taddress indexed to,\\n\\t\\tuint256 amount,\\n\\t\\tuint8 grantNumber,\\n\\t\\tuint8 stageNumber\\n\\t);\\n\\tevent UpdateGrant(\\n\\t\\tuint256 indexed grantId,\\n\\t\\taddress indexed to,\\n\\t\\tuint256 cap,\\n\\t\\tuint256 last,\\n\\t\\tuint256 amountLeft,\\n\\t\\tuint8 grantNumber,\\n\\t\\tuint8 stageNumber\\n\\t);\\n\\tevent AddOwner(address indexed newOwner, address indexed addedBy);\\n\\tevent RemoveOwner(address indexed removedOwner, address indexed removedBy);\\n\\n\\t// Custom errors\\n\\terror NoActiveStream();\\n\\terror InsufficientContractFunds();\\n\\terror UnauthorizedWithdrawal();\\n\\terror InsufficientStreamFunds();\\n\\terror FailedToSendEther();\\n\\terror PreviousAmountNotFullyWithdrawn();\\n\\n\\tconstructor(address[] memory _initialOwners) {\\n\\t\\t_setRoleAdmin(OWNER_ROLE, OWNER_ROLE);\\n\\t\\tfor (uint i = 0; i < _initialOwners.length; i++) {\\n\\t\\t\\t_grantRole(OWNER_ROLE, _initialOwners[i]);\\n\\t\\t}\\n\\t}\\n\\n\\tfunction unlockedGrantAmount(\\n\\t\\tuint256 _grantId\\n\\t) public view returns (uint256) {\\n\\t\\tGrantStream memory grantStream = grantStreams[_grantId];\\n\\t\\tif (grantStream.cap == 0) revert NoActiveStream();\\n\\n\\t\\tif (grantStream.amountLeft == 0) {\\n\\t\\t\\treturn 0;\\n\\t\\t}\\n\\n\\t\\tuint256 elapsedTime = block.timestamp - grantStream.last;\\n\\t\\tuint256 unlockedAmount = (grantStream.cap * elapsedTime) /\\n\\t\\t\\tFULL_STREAM_UNLOCK_PERIOD;\\n\\n\\t\\treturn\\n\\t\\t\\tunlockedAmount > grantStream.amountLeft\\n\\t\\t\\t\\t? grantStream.amountLeft\\n\\t\\t\\t\\t: unlockedAmount;\\n\\t}\\n\\n\\tfunction addGrantStream(\\n\\t\\taddress _builder,\\n\\t\\tuint256 _cap,\\n\\t\\tuint8 _grantNumber\\n\\t) public onlyRole(OWNER_ROLE) returns (uint256) {\\n\\t\\tuint256 grantId = nextGrantId++;\\n\\t\\tgrantStreams[grantId] = GrantStream({\\n\\t\\t\\tcap: _cap,\\n\\t\\t\\tlast: block.timestamp,\\n\\t\\t\\tamountLeft: _cap,\\n\\t\\t\\tgrantNumber: _grantNumber,\\n\\t\\t\\tstageNumber: 1,\\n\\t\\t\\tbuilder: _builder\\n\\t\\t});\\n\\t\\tbuilderGrants[_builder].push(grantId);\\n\\t\\temit AddGrant(grantId, _builder, _cap);\\n\\t\\treturn grantId;\\n\\t}\\n\\n\\tfunction moveGrantToNextStage(\\n\\t\\tuint256 _grantId,\\n\\t\\tuint256 _cap\\n\\t) public onlyRole(OWNER_ROLE) {\\n\\t\\tGrantStream storage grantStream = grantStreams[_grantId];\\n\\t\\tif (grantStream.cap == 0) revert NoActiveStream();\\n\\n\\t\\tif (grantStream.amountLeft > DUST_THRESHOLD)\\n\\t\\t\\trevert PreviousAmountNotFullyWithdrawn();\\n\\n\\t\\tif (grantStream.amountLeft > 0) {\\n\\t\\t\\t(bool sent, ) = payable(grantStream.builder).call{\\n\\t\\t\\t\\tvalue: grantStream.amountLeft\\n\\t\\t\\t}(\\\"\\\");\\n\\t\\t\\tif (!sent) revert FailedToSendEther();\\n\\t\\t}\\n\\n\\t\\tgrantStream.cap = _cap;\\n\\t\\tgrantStream.last = block.timestamp;\\n\\t\\tgrantStream.amountLeft = _cap;\\n\\t\\tgrantStream.stageNumber += 1;\\n\\n\\t\\temit MoveGrantToNextStage(\\n\\t\\t\\t_grantId,\\n\\t\\t\\tgrantStream.builder,\\n\\t\\t\\t_cap,\\n\\t\\t\\tgrantStream.grantNumber,\\n\\t\\t\\tgrantStream.stageNumber\\n\\t\\t);\\n\\t}\\n\\n\\tfunction updateGrant(\\n\\t\\tuint256 _grantId,\\n\\t\\tuint256 _cap,\\n\\t\\tuint256 _last,\\n\\t\\tuint256 _amountLeft,\\n\\t\\tuint8 _stageNumber\\n\\t) public onlyRole(OWNER_ROLE) {\\n\\t\\tGrantStream storage grantStream = grantStreams[_grantId];\\n\\t\\tif (grantStream.cap == 0) revert NoActiveStream();\\n\\t\\tgrantStream.cap = _cap;\\n\\t\\tgrantStream.last = _last;\\n\\t\\tgrantStream.amountLeft = _amountLeft;\\n\\t\\tgrantStream.stageNumber = _stageNumber;\\n\\n\\t\\temit UpdateGrant(\\n\\t\\t\\t_grantId,\\n\\t\\t\\tgrantStream.builder,\\n\\t\\t\\t_cap,\\n\\t\\t\\tgrantStream.last,\\n\\t\\t\\tgrantStream.amountLeft,\\n\\t\\t\\tgrantStream.grantNumber,\\n\\t\\t\\tgrantStream.stageNumber\\n\\t\\t);\\n\\t}\\n\\n\\tfunction streamWithdraw(\\n\\t\\tuint256 _grantId,\\n\\t\\tuint256 _amount,\\n\\t\\tstring memory _reason\\n\\t) public {\\n\\t\\tif (address(this).balance < _amount) revert InsufficientContractFunds();\\n\\t\\tGrantStream storage grantStream = grantStreams[_grantId];\\n\\t\\tif (grantStream.cap == 0) revert NoActiveStream();\\n\\t\\tif (msg.sender != grantStream.builder) revert UnauthorizedWithdrawal();\\n\\n\\t\\tuint256 totalAmountCanWithdraw = unlockedGrantAmount(_grantId);\\n\\t\\tif (totalAmountCanWithdraw < _amount) revert InsufficientStreamFunds();\\n\\n\\t\\tuint256 elapsedTime = block.timestamp - grantStream.last;\\n\\t\\tuint256 timeToDeduct = (elapsedTime * _amount) / totalAmountCanWithdraw;\\n\\n\\t\\tgrantStream.last = grantStream.last + timeToDeduct;\\n\\t\\tgrantStream.amountLeft -= _amount;\\n\\n\\t\\t(bool sent, ) = msg.sender.call{ value: _amount }(\\\"\\\");\\n\\t\\tif (!sent) revert FailedToSendEther();\\n\\n\\t\\temit Withdraw(\\n\\t\\t\\tmsg.sender,\\n\\t\\t\\t_amount,\\n\\t\\t\\t_reason,\\n\\t\\t\\t_grantId,\\n\\t\\t\\tgrantStream.grantNumber,\\n\\t\\t\\tgrantStream.stageNumber\\n\\t\\t);\\n\\t}\\n\\n\\tfunction getBuilderGrantCount(\\n\\t\\taddress _builder\\n\\t) public view returns (uint256) {\\n\\t\\treturn builderGrants[_builder].length;\\n\\t}\\n\\n\\tfunction addOwner(address newOwner) public onlyRole(OWNER_ROLE) {\\n\\t\\tgrantRole(OWNER_ROLE, newOwner);\\n\\t\\temit AddOwner(newOwner, msg.sender);\\n\\t}\\n\\n\\tfunction removeOwner(address owner) public onlyRole(OWNER_ROLE) {\\n\\t\\trevokeRole(OWNER_ROLE, owner);\\n\\t\\temit RemoveOwner(owner, msg.sender);\\n\\t}\\n\\n\\treceive() external payable {}\\n\\n\\tfallback() external payable {}\\n}\\n\",\"keccak256\":\"0xf5915a4a9feb7db4b58cdd9de70ceab466c11d75769d2596452336c6f75b62ce\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260016002553480156200001657600080fd5b5060405162001863380380620018638339810160408190526200003991620001da565b620000546000805160206200184383398151915280620000bb565b60005b8151811015620000b3576200009e600080516020620018438339815191528383815181106200008a576200008a620002ac565b60200260200101516200010660201b60201c565b80620000aa81620002c2565b91505062000057565b5050620002ea565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001a3576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001623390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620001d557600080fd5b919050565b60006020808385031215620001ee57600080fd5b82516001600160401b03808211156200020657600080fd5b818501915085601f8301126200021b57600080fd5b815181811115620002305762000230620001a7565b8060051b604051601f19603f83011681018181108582111715620002585762000258620001a7565b6040529182528482019250838101850191888311156200027757600080fd5b938501935b82851015620002a0576200029085620001bd565b845293850193928501926200027c565b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060018201620002e357634e487b7160e01b600052601160045260246000fd5b5060010190565b61154980620002fa6000396000f3fe6080604052600436106101225760003560e01c80638f9eb24d116100a5578063bb8b3ea91161006c578063bb8b3ea914610328578063d547741f1461033e578063dd7dc9a91461035e578063e58378bb14610379578063ed2c9d091461039b578063f1f693d11461043857005b80638f9eb24d1461029e57806391d14854146102be578063a217fddf146102de578063ae69f6db146102f3578063b493eca11461031357005b8063378c3286116100e9578063378c3286146101fe578063543d55d51461021e5780636770c53f1461023e5780637065cb481461025e5780637370c2241461027e57005b806301ffc9a71461012b578063173825d914610160578063248a9ca3146101805780632f2ff15d146101be57806336568abe146101de57005b3661012957005b005b34801561013757600080fd5b5061014b6101463660046110ab565b61046e565b60405190151581526020015b60405180910390f35b34801561016c57600080fd5b5061012961017b3660046110f1565b6104a5565b34801561018c57600080fd5b506101b061019b36600461110c565b60009081526020819052604090206001015490565b604051908152602001610157565b3480156101ca57600080fd5b506101296101d9366004611125565b61050f565b3480156101ea57600080fd5b506101296101f9366004611125565b610539565b34801561020a57600080fd5b50610129610219366004611151565b6105bc565b34801561022a57600080fd5b506101b0610239366004611184565b61076c565b34801561024a57600080fd5b506101296102593660046111d6565b610916565b34801561026a57600080fd5b506101296102793660046110f1565b610ae9565b34801561028a57600080fd5b506101b061029936600461110c565b610b53565b3480156102aa57600080fd5b506101296102b936600461129a565b610c3e565b3480156102ca57600080fd5b5061014b6102d9366004611125565b610d28565b3480156102ea57600080fd5b506101b0600081565b3480156102ff57600080fd5b506101b061030e3660046112e3565b610d51565b34801561031f57600080fd5b506101b060b481565b34801561033457600080fd5b506101b060025481565b34801561034a57600080fd5b50610129610359366004611125565b610d82565b34801561036a57600080fd5b506101b066038d7ea4c6800081565b34801561038557600080fd5b506101b06000805160206114f483398151915281565b3480156103a757600080fd5b506103fc6103b636600461110c565b6001602081905260009182526040909120805491810154600282015460039092015490919060ff808216916101008104909116906201000090046001600160a01b031686565b6040805196875260208701959095529385019290925260ff90811660608501521660808301526001600160a01b031660a082015260c001610157565b34801561044457600080fd5b506101b06104533660046110f1565b6001600160a01b031660009081526003602052604090205490565b60006001600160e01b03198216637965db0b60e01b148061049f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000805160206114f48339815191526104bd81610da7565b6104d56000805160206114f483398151915283610d82565b60405133906001600160a01b038416907fca273b61904dd225d0c1e905343c24040cecad0b4491337492c990845edb525790600090a35050565b60008281526020819052604090206001015461052a81610da7565b6105348383610db4565b505050565b6001600160a01b03811633146105ae5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105b88282610e38565b5050565b6000805160206114f48339815191526105d481610da7565b6000838152600160205260408120805490910361060457604051631b017f1760e11b815260040160405180910390fd5b66038d7ea4c68000816002015411156106305760405163d4eff9fb60e01b815260040160405180910390fd5b6002810154156106bc57600381015460028201546040516000926201000090046001600160a01b031691908381818185875af1925050503d8060008114610693576040519150601f19603f3d011682016040523d82523d6000602084013e610698565b606091505b50509050806106ba57604051630dcf35db60e41b815260040160405180910390fd5b505b828155426001808301919091556002820184905560038201805482906106eb908290610100900460ff16611323565b825461010092830a60ff8181021990921692821602919091179092556003840154604080518881528285166020820152928204909316828401529151620100009092046001600160a01b0316925086917f17ee42885f0e22165eac00b186d2f6967173c5d903e21a7d80ceddf6645e2e8c916060908290030190a350505050565b60006000805160206114f483398151915261078681610da7565b60028054600091826107978361133c565b9190505590506040518060c001604052808681526020014281526020018681526020018560ff168152602001600160ff168152602001876001600160a01b03168152506001600083815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908360ff16021790555060808201518160030160016101000a81548160ff021916908360ff16021790555060a08201518160030160026101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505060036000876001600160a01b03166001600160a01b03168152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915055856001600160a01b0316817f4d140f3ab7e8fb4ad26897fc618b16b04dc99070c528dc3f0a83a4ee095bb38c8760405161090591815260200190565b60405180910390a395945050505050565b814710156109375760405163a3fb8f9d60e01b815260040160405180910390fd5b6000838152600160205260408120805490910361096757604051631b017f1760e11b815260040160405180910390fd5b60038101546201000090046001600160a01b0316331461099a576040516360b39bc560e01b815260040160405180910390fd5b60006109a585610b53565b9050838110156109c85760405163347efb5160e01b815260040160405180910390fd5b60008260010154426109da9190611355565b90506000826109e98784611368565b6109f3919061137f565b9050808460010154610a0591906113a1565b846001018190555085846002016000828254610a219190611355565b9091555050604051600090339088908381818185875af1925050503d8060008114610a68576040519150601f19603f3d011682016040523d82523d6000602084013e610a6d565b606091505b5050905080610a8f57604051630dcf35db60e41b815260040160405180910390fd5b600385015460405133917f47c0670222fad9b95e64bb97dfc188690542d35c688bd1621c1d82b0420e0f0d91610ad7918b918b918e9160ff8083169261010090041690611404565b60405180910390a25050505050505050565b6000805160206114f4833981519152610b0181610da7565b610b196000805160206114f48339815191528361050f565b60405133906001600160a01b038416907f91a3131740191cd3eb4fc72bf2cbcd5ab483dcdf168f2307451becc3e5dae55690600090a35050565b6000818152600160208181526040808420815160c081018352815480825294820154938101939093526002810154918301919091526003015460ff808216606084015261010082041660808301526201000090046001600160a01b031660a0820152908203610bd557604051631b017f1760e11b815260040160405180910390fd5b8060400151600003610bea5750600092915050565b6000816020015142610bfc9190611355565b9050600060b4828460000151610c129190611368565b610c1c919061137f565b905082604001518111610c2f5780610c35565b82604001515b95945050505050565b6000805160206114f4833981519152610c5681610da7565b60008681526001602052604081208054909103610c8657604051631b017f1760e11b815260040160405180910390fd5b858155600181018590556002810184905560038101805461ff0019811661010060ff878116820292831794859055604080518c8152602081018c90529081018a90529381169281169290921760608401528304166080820152620100009091046001600160a01b03169088907f548e40d7e4654aa5af9a6984f2cea5a5b9bbd2104ecdfeea5858590c6672694c9060a00160405180910390a350505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60036020528160005260406000208181548110610d6d57600080fd5b90600052602060002001600091509150505481565b600082815260208190526040902060010154610d9d81610da7565b6105348383610e38565b610db18133610e9d565b50565b610dbe8282610d28565b6105b8576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610df43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610e428282610d28565b156105b8576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610ea78282610d28565b6105b857610eb481610ef6565b610ebf836020610f08565b604051602001610ed092919061143e565b60408051601f198184030181529082905262461bcd60e51b82526105a5916004016114b3565b606061049f6001600160a01b03831660145b60606000610f17836002611368565b610f229060026113a1565b67ffffffffffffffff811115610f3a57610f3a6111c0565b6040519080825280601f01601f191660200182016040528015610f64576020820181803683370190505b509050600360fc1b81600081518110610f7f57610f7f6114c6565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610fae57610fae6114c6565b60200101906001600160f81b031916908160001a9053506000610fd2846002611368565b610fdd9060016113a1565b90505b6001811115611055576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611011576110116114c6565b1a60f81b828281518110611027576110276114c6565b60200101906001600160f81b031916908160001a90535060049490941c9361104e816114dc565b9050610fe0565b5083156110a45760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105a5565b9392505050565b6000602082840312156110bd57600080fd5b81356001600160e01b0319811681146110a457600080fd5b80356001600160a01b03811681146110ec57600080fd5b919050565b60006020828403121561110357600080fd5b6110a4826110d5565b60006020828403121561111e57600080fd5b5035919050565b6000806040838503121561113857600080fd5b82359150611148602084016110d5565b90509250929050565b6000806040838503121561116457600080fd5b50508035926020909101359150565b803560ff811681146110ec57600080fd5b60008060006060848603121561119957600080fd5b6111a2846110d5565b9250602084013591506111b760408501611173565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156111eb57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561121157600080fd5b818601915086601f83011261122557600080fd5b813581811115611237576112376111c0565b604051601f8201601f19908116603f0116810190838211818310171561125f5761125f6111c0565b8160405282815289602084870101111561127857600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b600080600080600060a086880312156112b257600080fd5b853594506020860135935060408601359250606086013591506112d760808701611173565b90509295509295909350565b600080604083850312156112f657600080fd5b6112ff836110d5565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561049f5761049f61130d565b60006001820161134e5761134e61130d565b5060010190565b8181038181111561049f5761049f61130d565b808202811582820484141761049f5761049f61130d565b60008261139c57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561049f5761049f61130d565b60005b838110156113cf5781810151838201526020016113b7565b50506000910152565b600081518084526113f08160208601602086016113b4565b601f01601f19169290920160200192915050565b85815260a06020820152600061141d60a08301876113d8565b60408301959095525060ff9283166060820152911660809091015292915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516114768160178501602088016113b4565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516114a78160288401602088016113b4565b01602801949350505050565b6020815260006110a460208301846113d8565b634e487b7160e01b600052603260045260246000fd5b6000816114eb576114eb61130d565b50600019019056feb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214ea2646970667358221220ff6e1722a4db24900b0b16bf92418a2f66f8054b2e46c6f8d1b867836d7aa23b64736f6c63430008110033b19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e", - "deployedBytecode": "0x6080604052600436106101225760003560e01c80638f9eb24d116100a5578063bb8b3ea91161006c578063bb8b3ea914610328578063d547741f1461033e578063dd7dc9a91461035e578063e58378bb14610379578063ed2c9d091461039b578063f1f693d11461043857005b80638f9eb24d1461029e57806391d14854146102be578063a217fddf146102de578063ae69f6db146102f3578063b493eca11461031357005b8063378c3286116100e9578063378c3286146101fe578063543d55d51461021e5780636770c53f1461023e5780637065cb481461025e5780637370c2241461027e57005b806301ffc9a71461012b578063173825d914610160578063248a9ca3146101805780632f2ff15d146101be57806336568abe146101de57005b3661012957005b005b34801561013757600080fd5b5061014b6101463660046110ab565b61046e565b60405190151581526020015b60405180910390f35b34801561016c57600080fd5b5061012961017b3660046110f1565b6104a5565b34801561018c57600080fd5b506101b061019b36600461110c565b60009081526020819052604090206001015490565b604051908152602001610157565b3480156101ca57600080fd5b506101296101d9366004611125565b61050f565b3480156101ea57600080fd5b506101296101f9366004611125565b610539565b34801561020a57600080fd5b50610129610219366004611151565b6105bc565b34801561022a57600080fd5b506101b0610239366004611184565b61076c565b34801561024a57600080fd5b506101296102593660046111d6565b610916565b34801561026a57600080fd5b506101296102793660046110f1565b610ae9565b34801561028a57600080fd5b506101b061029936600461110c565b610b53565b3480156102aa57600080fd5b506101296102b936600461129a565b610c3e565b3480156102ca57600080fd5b5061014b6102d9366004611125565b610d28565b3480156102ea57600080fd5b506101b0600081565b3480156102ff57600080fd5b506101b061030e3660046112e3565b610d51565b34801561031f57600080fd5b506101b060b481565b34801561033457600080fd5b506101b060025481565b34801561034a57600080fd5b50610129610359366004611125565b610d82565b34801561036a57600080fd5b506101b066038d7ea4c6800081565b34801561038557600080fd5b506101b06000805160206114f483398151915281565b3480156103a757600080fd5b506103fc6103b636600461110c565b6001602081905260009182526040909120805491810154600282015460039092015490919060ff808216916101008104909116906201000090046001600160a01b031686565b6040805196875260208701959095529385019290925260ff90811660608501521660808301526001600160a01b031660a082015260c001610157565b34801561044457600080fd5b506101b06104533660046110f1565b6001600160a01b031660009081526003602052604090205490565b60006001600160e01b03198216637965db0b60e01b148061049f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000805160206114f48339815191526104bd81610da7565b6104d56000805160206114f483398151915283610d82565b60405133906001600160a01b038416907fca273b61904dd225d0c1e905343c24040cecad0b4491337492c990845edb525790600090a35050565b60008281526020819052604090206001015461052a81610da7565b6105348383610db4565b505050565b6001600160a01b03811633146105ae5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6105b88282610e38565b5050565b6000805160206114f48339815191526105d481610da7565b6000838152600160205260408120805490910361060457604051631b017f1760e11b815260040160405180910390fd5b66038d7ea4c68000816002015411156106305760405163d4eff9fb60e01b815260040160405180910390fd5b6002810154156106bc57600381015460028201546040516000926201000090046001600160a01b031691908381818185875af1925050503d8060008114610693576040519150601f19603f3d011682016040523d82523d6000602084013e610698565b606091505b50509050806106ba57604051630dcf35db60e41b815260040160405180910390fd5b505b828155426001808301919091556002820184905560038201805482906106eb908290610100900460ff16611323565b825461010092830a60ff8181021990921692821602919091179092556003840154604080518881528285166020820152928204909316828401529151620100009092046001600160a01b0316925086917f17ee42885f0e22165eac00b186d2f6967173c5d903e21a7d80ceddf6645e2e8c916060908290030190a350505050565b60006000805160206114f483398151915261078681610da7565b60028054600091826107978361133c565b9190505590506040518060c001604052808681526020014281526020018681526020018560ff168152602001600160ff168152602001876001600160a01b03168152506001600083815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff021916908360ff16021790555060808201518160030160016101000a81548160ff021916908360ff16021790555060a08201518160030160026101000a8154816001600160a01b0302191690836001600160a01b0316021790555090505060036000876001600160a01b03166001600160a01b03168152602001908152602001600020819080600181540180825580915050600190039060005260206000200160009091909190915055856001600160a01b0316817f4d140f3ab7e8fb4ad26897fc618b16b04dc99070c528dc3f0a83a4ee095bb38c8760405161090591815260200190565b60405180910390a395945050505050565b814710156109375760405163a3fb8f9d60e01b815260040160405180910390fd5b6000838152600160205260408120805490910361096757604051631b017f1760e11b815260040160405180910390fd5b60038101546201000090046001600160a01b0316331461099a576040516360b39bc560e01b815260040160405180910390fd5b60006109a585610b53565b9050838110156109c85760405163347efb5160e01b815260040160405180910390fd5b60008260010154426109da9190611355565b90506000826109e98784611368565b6109f3919061137f565b9050808460010154610a0591906113a1565b846001018190555085846002016000828254610a219190611355565b9091555050604051600090339088908381818185875af1925050503d8060008114610a68576040519150601f19603f3d011682016040523d82523d6000602084013e610a6d565b606091505b5050905080610a8f57604051630dcf35db60e41b815260040160405180910390fd5b600385015460405133917f47c0670222fad9b95e64bb97dfc188690542d35c688bd1621c1d82b0420e0f0d91610ad7918b918b918e9160ff8083169261010090041690611404565b60405180910390a25050505050505050565b6000805160206114f4833981519152610b0181610da7565b610b196000805160206114f48339815191528361050f565b60405133906001600160a01b038416907f91a3131740191cd3eb4fc72bf2cbcd5ab483dcdf168f2307451becc3e5dae55690600090a35050565b6000818152600160208181526040808420815160c081018352815480825294820154938101939093526002810154918301919091526003015460ff808216606084015261010082041660808301526201000090046001600160a01b031660a0820152908203610bd557604051631b017f1760e11b815260040160405180910390fd5b8060400151600003610bea5750600092915050565b6000816020015142610bfc9190611355565b9050600060b4828460000151610c129190611368565b610c1c919061137f565b905082604001518111610c2f5780610c35565b82604001515b95945050505050565b6000805160206114f4833981519152610c5681610da7565b60008681526001602052604081208054909103610c8657604051631b017f1760e11b815260040160405180910390fd5b858155600181018590556002810184905560038101805461ff0019811661010060ff878116820292831794859055604080518c8152602081018c90529081018a90529381169281169290921760608401528304166080820152620100009091046001600160a01b03169088907f548e40d7e4654aa5af9a6984f2cea5a5b9bbd2104ecdfeea5858590c6672694c9060a00160405180910390a350505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60036020528160005260406000208181548110610d6d57600080fd5b90600052602060002001600091509150505481565b600082815260208190526040902060010154610d9d81610da7565b6105348383610e38565b610db18133610e9d565b50565b610dbe8282610d28565b6105b8576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610df43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610e428282610d28565b156105b8576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610ea78282610d28565b6105b857610eb481610ef6565b610ebf836020610f08565b604051602001610ed092919061143e565b60408051601f198184030181529082905262461bcd60e51b82526105a5916004016114b3565b606061049f6001600160a01b03831660145b60606000610f17836002611368565b610f229060026113a1565b67ffffffffffffffff811115610f3a57610f3a6111c0565b6040519080825280601f01601f191660200182016040528015610f64576020820181803683370190505b509050600360fc1b81600081518110610f7f57610f7f6114c6565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610fae57610fae6114c6565b60200101906001600160f81b031916908160001a9053506000610fd2846002611368565b610fdd9060016113a1565b90505b6001811115611055576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611011576110116114c6565b1a60f81b828281518110611027576110276114c6565b60200101906001600160f81b031916908160001a90535060049490941c9361104e816114dc565b9050610fe0565b5083156110a45760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105a5565b9392505050565b6000602082840312156110bd57600080fd5b81356001600160e01b0319811681146110a457600080fd5b80356001600160a01b03811681146110ec57600080fd5b919050565b60006020828403121561110357600080fd5b6110a4826110d5565b60006020828403121561111e57600080fd5b5035919050565b6000806040838503121561113857600080fd5b82359150611148602084016110d5565b90509250929050565b6000806040838503121561116457600080fd5b50508035926020909101359150565b803560ff811681146110ec57600080fd5b60008060006060848603121561119957600080fd5b6111a2846110d5565b9250602084013591506111b760408501611173565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156111eb57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561121157600080fd5b818601915086601f83011261122557600080fd5b813581811115611237576112376111c0565b604051601f8201601f19908116603f0116810190838211818310171561125f5761125f6111c0565b8160405282815289602084870101111561127857600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b600080600080600060a086880312156112b257600080fd5b853594506020860135935060408601359250606086013591506112d760808701611173565b90509295509295909350565b600080604083850312156112f657600080fd5b6112ff836110d5565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561049f5761049f61130d565b60006001820161134e5761134e61130d565b5060010190565b8181038181111561049f5761049f61130d565b808202811582820484141761049f5761049f61130d565b60008261139c57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561049f5761049f61130d565b60005b838110156113cf5781810151838201526020016113b7565b50506000910152565b600081518084526113f08160208601602086016113b4565b601f01601f19169290920160200192915050565b85815260a06020820152600061141d60a08301876113d8565b60408301959095525060ff9283166060820152911660809091015292915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516114768160178501602088016113b4565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516114a78160288401602088016113b4565b01602801949350505050565b6020815260006110a460208301846113d8565b634e487b7160e01b600052603260045260246000fd5b6000816114eb576114eb61130d565b50600019019056feb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214ea2646970667358221220ff6e1722a4db24900b0b16bf92418a2f66f8054b2e46c6f8d1b867836d7aa23b64736f6c63430008110033", - "devdoc": { - "kind": "dev", - "methods": { - "getRoleAdmin(bytes32)": { - "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." - }, - "grantRole(bytes32,address)": { - "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." - }, - "hasRole(bytes32,address)": { - "details": "Returns `true` if `account` has been granted `role`." - }, - "renounceRole(bytes32,address)": { - "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event." - }, - "revokeRole(bytes32,address)": { - "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." - }, - "supportsInterface(bytes4)": { - "details": "See {IERC165-supportsInterface}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 24, - "contract": "contracts/Stream.sol:Stream", - "label": "_roles", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 1514, - "contract": "contracts/Stream.sol:Stream", - "label": "grantStreams", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(GrantStream)1509_storage)" - }, - { - "astId": 1517, - "contract": "contracts/Stream.sol:Stream", - "label": "nextGrantId", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 1522, - "contract": "contracts/Stream.sol:Stream", - "label": "builderGrants", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_array(t_uint256)dyn_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)dyn_storage": { - "base": "t_uint256", - "encoding": "dynamic_array", - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_uint256)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256[])", - "numberOfBytes": "32", - "value": "t_array(t_uint256)dyn_storage" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct AccessControl.RoleData)", - "numberOfBytes": "32", - "value": "t_struct(RoleData)19_storage" - }, - "t_mapping(t_uint256,t_struct(GrantStream)1509_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct Stream.GrantStream)", - "numberOfBytes": "32", - "value": "t_struct(GrantStream)1509_storage" - }, - "t_struct(GrantStream)1509_storage": { - "encoding": "inplace", - "label": "struct Stream.GrantStream", - "members": [ - { - "astId": 1498, - "contract": "contracts/Stream.sol:Stream", - "label": "cap", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 1500, - "contract": "contracts/Stream.sol:Stream", - "label": "last", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 1502, - "contract": "contracts/Stream.sol:Stream", - "label": "amountLeft", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 1504, - "contract": "contracts/Stream.sol:Stream", - "label": "grantNumber", - "offset": 0, - "slot": "3", - "type": "t_uint8" - }, - { - "astId": 1506, - "contract": "contracts/Stream.sol:Stream", - "label": "stageNumber", - "offset": 1, - "slot": "3", - "type": "t_uint8" - }, - { - "astId": 1508, - "contract": "contracts/Stream.sol:Stream", - "label": "builder", - "offset": 2, - "slot": "3", - "type": "t_address" - } - ], - "numberOfBytes": "128" - }, - "t_struct(RoleData)19_storage": { - "encoding": "inplace", - "label": "struct AccessControl.RoleData", - "members": [ - { - "astId": 16, - "contract": "contracts/Stream.sol:Stream", - "label": "members", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_bool)" - }, - { - "astId": 18, - "contract": "contracts/Stream.sol:Stream", - "label": "adminRole", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/packages/hardhat/deployments/sepolia/solcInputs/66949c7747c59450b1528b6c03e97e3b.json b/packages/hardhat/deployments/sepolia/solcInputs/66949c7747c59450b1528b6c03e97e3b.json deleted file mode 100644 index fadf364..0000000 --- a/packages/hardhat/deployments/sepolia/solcInputs/66949c7747c59450b1528b6c03e97e3b.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "contracts/Stream.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity >=0.8.0 <0.9.0;\n\nimport \"@openzeppelin/contracts/access/AccessControl.sol\";\n\ncontract Stream is AccessControl {\n\tbytes32 public constant OWNER_ROLE = keccak256(\"OWNER_ROLE\");\n\n\tstruct GrantStream {\n\t\tuint256 cap;\n\t\tuint256 last;\n\t\tuint256 amountLeft;\n\t\tuint8 grantNumber;\n\t\tuint8 stageNumber;\n\t\taddress builder;\n\t}\n\n\tmapping(uint256 => GrantStream) public grantStreams;\n\tuint256 public nextGrantId = 1;\n\n\tmapping(address => uint256[]) public builderGrants;\n\n\tuint256 public constant FULL_STREAM_UNLOCK_PERIOD = 180; // 30 days\n\tuint256 public constant DUST_THRESHOLD = 1000000000000000; // 0.001 ETH\n\n\tevent Withdraw(\n\t\taddress indexed to,\n\t\tuint256 amount,\n\t\tstring reason,\n\t\tuint256 grantId,\n\t\tuint8 grantNumber,\n\t\tuint8 stageNumber\n\t);\n\tevent AddGrant(uint256 indexed grantId, address indexed to, uint256 amount);\n\tevent MoveGrantToNextStage(\n\t\tuint256 indexed grantId,\n\t\taddress indexed to,\n\t\tuint256 amount,\n\t\tuint8 grantNumber,\n\t\tuint8 stageNumber\n\t);\n\tevent UpdateGrant(\n\t\tuint256 indexed grantId,\n\t\taddress indexed to,\n\t\tuint256 cap,\n\t\tuint256 last,\n\t\tuint256 amountLeft,\n\t\tuint8 grantNumber,\n\t\tuint8 stageNumber\n\t);\n\tevent AddOwner(address indexed newOwner, address indexed addedBy);\n\tevent RemoveOwner(address indexed removedOwner, address indexed removedBy);\n\n\t// Custom errors\n\terror NoActiveStream();\n\terror InsufficientContractFunds();\n\terror UnauthorizedWithdrawal();\n\terror InsufficientStreamFunds();\n\terror FailedToSendEther();\n\terror PreviousAmountNotFullyWithdrawn();\n\n\tconstructor(address[] memory _initialOwners) {\n\t\t_setRoleAdmin(OWNER_ROLE, OWNER_ROLE);\n\t\tfor (uint i = 0; i < _initialOwners.length; i++) {\n\t\t\t_grantRole(OWNER_ROLE, _initialOwners[i]);\n\t\t}\n\t}\n\n\tfunction unlockedGrantAmount(\n\t\tuint256 _grantId\n\t) public view returns (uint256) {\n\t\tGrantStream memory grantStream = grantStreams[_grantId];\n\t\tif (grantStream.cap == 0) revert NoActiveStream();\n\n\t\tif (grantStream.amountLeft == 0) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tuint256 elapsedTime = block.timestamp - grantStream.last;\n\t\tuint256 unlockedAmount = (grantStream.cap * elapsedTime) /\n\t\t\tFULL_STREAM_UNLOCK_PERIOD;\n\n\t\treturn\n\t\t\tunlockedAmount > grantStream.amountLeft\n\t\t\t\t? grantStream.amountLeft\n\t\t\t\t: unlockedAmount;\n\t}\n\n\tfunction addGrantStream(\n\t\taddress _builder,\n\t\tuint256 _cap,\n\t\tuint8 _grantNumber\n\t) public onlyRole(OWNER_ROLE) returns (uint256) {\n\t\tuint256 grantId = nextGrantId++;\n\t\tgrantStreams[grantId] = GrantStream({\n\t\t\tcap: _cap,\n\t\t\tlast: block.timestamp,\n\t\t\tamountLeft: _cap,\n\t\t\tgrantNumber: _grantNumber,\n\t\t\tstageNumber: 1,\n\t\t\tbuilder: _builder\n\t\t});\n\t\tbuilderGrants[_builder].push(grantId);\n\t\temit AddGrant(grantId, _builder, _cap);\n\t\treturn grantId;\n\t}\n\n\tfunction moveGrantToNextStage(\n\t\tuint256 _grantId,\n\t\tuint256 _cap\n\t) public onlyRole(OWNER_ROLE) {\n\t\tGrantStream storage grantStream = grantStreams[_grantId];\n\t\tif (grantStream.cap == 0) revert NoActiveStream();\n\n\t\tif (grantStream.amountLeft > DUST_THRESHOLD)\n\t\t\trevert PreviousAmountNotFullyWithdrawn();\n\n\t\tif (grantStream.amountLeft > 0) {\n\t\t\t(bool sent, ) = payable(grantStream.builder).call{\n\t\t\t\tvalue: grantStream.amountLeft\n\t\t\t}(\"\");\n\t\t\tif (!sent) revert FailedToSendEther();\n\t\t}\n\n\t\tgrantStream.cap = _cap;\n\t\tgrantStream.last = block.timestamp;\n\t\tgrantStream.amountLeft = _cap;\n\t\tgrantStream.stageNumber += 1;\n\n\t\temit MoveGrantToNextStage(\n\t\t\t_grantId,\n\t\t\tgrantStream.builder,\n\t\t\t_cap,\n\t\t\tgrantStream.grantNumber,\n\t\t\tgrantStream.stageNumber\n\t\t);\n\t}\n\n\tfunction updateGrant(\n\t\tuint256 _grantId,\n\t\tuint256 _cap,\n\t\tuint256 _last,\n\t\tuint256 _amountLeft,\n\t\tuint8 _stageNumber\n\t) public onlyRole(OWNER_ROLE) {\n\t\tGrantStream storage grantStream = grantStreams[_grantId];\n\t\tif (grantStream.cap == 0) revert NoActiveStream();\n\t\tgrantStream.cap = _cap;\n\t\tgrantStream.last = _last;\n\t\tgrantStream.amountLeft = _amountLeft;\n\t\tgrantStream.stageNumber = _stageNumber;\n\n\t\temit UpdateGrant(\n\t\t\t_grantId,\n\t\t\tgrantStream.builder,\n\t\t\t_cap,\n\t\t\tgrantStream.last,\n\t\t\tgrantStream.amountLeft,\n\t\t\tgrantStream.grantNumber,\n\t\t\tgrantStream.stageNumber\n\t\t);\n\t}\n\n\tfunction streamWithdraw(\n\t\tuint256 _grantId,\n\t\tuint256 _amount,\n\t\tstring memory _reason\n\t) public {\n\t\tif (address(this).balance < _amount) revert InsufficientContractFunds();\n\t\tGrantStream storage grantStream = grantStreams[_grantId];\n\t\tif (grantStream.cap == 0) revert NoActiveStream();\n\t\tif (msg.sender != grantStream.builder) revert UnauthorizedWithdrawal();\n\n\t\tuint256 totalAmountCanWithdraw = unlockedGrantAmount(_grantId);\n\t\tif (totalAmountCanWithdraw < _amount) revert InsufficientStreamFunds();\n\n\t\tuint256 elapsedTime = block.timestamp - grantStream.last;\n\t\tuint256 timeToDeduct = (elapsedTime * _amount) / totalAmountCanWithdraw;\n\n\t\tgrantStream.last = grantStream.last + timeToDeduct;\n\t\tgrantStream.amountLeft -= _amount;\n\n\t\t(bool sent, ) = msg.sender.call{ value: _amount }(\"\");\n\t\tif (!sent) revert FailedToSendEther();\n\n\t\temit Withdraw(\n\t\t\tmsg.sender,\n\t\t\t_amount,\n\t\t\t_reason,\n\t\t\t_grantId,\n\t\t\tgrantStream.grantNumber,\n\t\t\tgrantStream.stageNumber\n\t\t);\n\t}\n\n\tfunction getBuilderGrantCount(\n\t\taddress _builder\n\t) public view returns (uint256) {\n\t\treturn builderGrants[_builder].length;\n\t}\n\n\tfunction addOwner(address newOwner) public onlyRole(OWNER_ROLE) {\n\t\tgrantRole(OWNER_ROLE, newOwner);\n\t\temit AddOwner(newOwner, msg.sender);\n\t}\n\n\tfunction removeOwner(address owner) public onlyRole(OWNER_ROLE) {\n\t\trevokeRole(OWNER_ROLE, owner);\n\t\temit RemoveOwner(owner, msg.sender);\n\t}\n\n\treceive() external payable {}\n\n\tfallback() external payable {}\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 268bc2d..a5ce03b 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -849,1598 +849,6 @@ const deployedContracts = { }, }, }, - 31337: { - Stream: { - address: "0x5FbDB2315678afecb367f032d93F642f64180aa3", - abi: [ - { - inputs: [ - { - internalType: "address[]", - name: "_initialOwners", - type: "address[]", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "AlreadyWithdrawnFromGrant", - type: "error", - }, - { - inputs: [], - name: "FailedToSendEther", - type: "error", - }, - { - inputs: [], - name: "InsufficientContractFunds", - type: "error", - }, - { - inputs: [], - name: "InsufficientStreamFunds", - type: "error", - }, - { - inputs: [], - name: "NoActiveStream", - type: "error", - }, - { - inputs: [], - name: "PreviousAmountNotFullyWithdrawn", - type: "error", - }, - { - inputs: [], - name: "UnauthorizedWithdrawal", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "AddGrant", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "addedBy", - type: "address", - }, - ], - name: "AddOwner", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "MoveGrantToNextStage", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "ReinitializeGrant", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "builder", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "ReinitializeNextStage", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "removedOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "removedBy", - type: "address", - }, - ], - name: "RemoveOwner", - 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: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "cap", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "last", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amountLeft", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "UpdateGrant", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "string", - name: "reason", - type: "string", - }, - { - indexed: false, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "Withdraw", - type: "event", - }, - { - stateMutability: "payable", - type: "fallback", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DUST_THRESHOLD", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "FULL_STREAM_UNLOCK_PERIOD", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "OWNER_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_builder", - type: "address", - }, - { - internalType: "uint256", - name: "_cap", - type: "uint256", - }, - { - internalType: "uint8", - name: "_grantNumber", - type: "uint8", - }, - ], - name: "addGrantStream", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "addOwner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "builderGrants", - outputs: [ - { - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_builder", - type: "address", - }, - ], - name: "getBuilderGrantCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_builder", - type: "address", - }, - { - internalType: "uint8", - name: "_grantNumber", - type: "uint8", - }, - ], - name: "getGrantIdByBuilderAndGrantNumber", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - 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: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "grantStreams", - outputs: [ - { - internalType: "uint256", - name: "cap", - type: "uint256", - }, - { - internalType: "uint256", - name: "last", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountLeft", - type: "uint256", - }, - { - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - { - internalType: "address", - name: "builder", - type: "address", - }, - ], - stateMutability: "view", - 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: "uint256", - name: "_grantId", - type: "uint256", - }, - { - internalType: "uint256", - name: "_cap", - type: "uint256", - }, - ], - name: "moveGrantToNextStage", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "nextGrantId", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "removeOwner", - 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: "_grantId", - type: "uint256", - }, - { - internalType: "uint256", - name: "_amount", - type: "uint256", - }, - { - internalType: "string", - name: "_reason", - type: "string", - }, - ], - name: "streamWithdraw", - 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: "_grantId", - type: "uint256", - }, - ], - name: "unlockedGrantAmount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "_grantId", - type: "uint256", - }, - { - internalType: "uint256", - name: "_cap", - type: "uint256", - }, - { - internalType: "uint256", - name: "_last", - type: "uint256", - }, - { - internalType: "uint256", - name: "_amountLeft", - type: "uint256", - }, - { - internalType: "uint8", - name: "_stageNumber", - type: "uint8", - }, - ], - name: "updateGrant", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, - ], - inheritedFunctions: { - DEFAULT_ADMIN_ROLE: "@openzeppelin/contracts/access/AccessControl.sol", - getRoleAdmin: "@openzeppelin/contracts/access/AccessControl.sol", - grantRole: "@openzeppelin/contracts/access/AccessControl.sol", - hasRole: "@openzeppelin/contracts/access/AccessControl.sol", - renounceRole: "@openzeppelin/contracts/access/AccessControl.sol", - revokeRole: "@openzeppelin/contracts/access/AccessControl.sol", - supportsInterface: "@openzeppelin/contracts/access/AccessControl.sol", - }, - }, - }, - 11155111: { - Stream: { - address: "0x725d9b8265CF7Cb77478C83fCC82020f789a389f", - abi: [ - { - inputs: [ - { - internalType: "address[]", - name: "_initialOwners", - type: "address[]", - }, - ], - stateMutability: "nonpayable", - type: "constructor", - }, - { - inputs: [], - name: "FailedToSendEther", - type: "error", - }, - { - inputs: [], - name: "InsufficientContractFunds", - type: "error", - }, - { - inputs: [], - name: "InsufficientStreamFunds", - type: "error", - }, - { - inputs: [], - name: "NoActiveStream", - type: "error", - }, - { - inputs: [], - name: "PreviousAmountNotFullyWithdrawn", - type: "error", - }, - { - inputs: [], - name: "UnauthorizedWithdrawal", - type: "error", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "AddGrant", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "newOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "addedBy", - type: "address", - }, - ], - name: "AddOwner", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "MoveGrantToNextStage", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "removedOwner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "removedBy", - type: "address", - }, - ], - name: "RemoveOwner", - 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: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "cap", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "last", - type: "uint256", - }, - { - indexed: false, - internalType: "uint256", - name: "amountLeft", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "UpdateGrant", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: false, - internalType: "uint256", - name: "amount", - type: "uint256", - }, - { - indexed: false, - internalType: "string", - name: "reason", - type: "string", - }, - { - indexed: false, - internalType: "uint256", - name: "grantId", - type: "uint256", - }, - { - indexed: false, - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - indexed: false, - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - ], - name: "Withdraw", - type: "event", - }, - { - stateMutability: "payable", - type: "fallback", - }, - { - inputs: [], - name: "DEFAULT_ADMIN_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DUST_THRESHOLD", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "FULL_STREAM_UNLOCK_PERIOD", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "OWNER_ROLE", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_builder", - type: "address", - }, - { - internalType: "uint256", - name: "_cap", - type: "uint256", - }, - { - internalType: "uint8", - name: "_grantNumber", - type: "uint8", - }, - ], - name: "addGrantStream", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "newOwner", - type: "address", - }, - ], - name: "addOwner", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "builderGrants", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "_builder", - type: "address", - }, - ], - name: "getBuilderGrantCount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - 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: "address", - name: "account", - type: "address", - }, - ], - name: "grantRole", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - name: "grantStreams", - outputs: [ - { - internalType: "uint256", - name: "cap", - type: "uint256", - }, - { - internalType: "uint256", - name: "last", - type: "uint256", - }, - { - internalType: "uint256", - name: "amountLeft", - type: "uint256", - }, - { - internalType: "uint8", - name: "grantNumber", - type: "uint8", - }, - { - internalType: "uint8", - name: "stageNumber", - type: "uint8", - }, - { - internalType: "address", - name: "builder", - type: "address", - }, - ], - stateMutability: "view", - 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: "uint256", - name: "_grantId", - type: "uint256", - }, - { - internalType: "uint256", - name: "_cap", - type: "uint256", - }, - ], - name: "moveGrantToNextStage", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "nextGrantId", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "removeOwner", - 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: "_grantId", - type: "uint256", - }, - { - internalType: "uint256", - name: "_amount", - type: "uint256", - }, - { - internalType: "string", - name: "_reason", - type: "string", - }, - ], - name: "streamWithdraw", - 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: "_grantId", - type: "uint256", - }, - ], - name: "unlockedGrantAmount", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "_grantId", - type: "uint256", - }, - { - internalType: "uint256", - name: "_cap", - type: "uint256", - }, - { - internalType: "uint256", - name: "_last", - type: "uint256", - }, - { - internalType: "uint256", - name: "_amountLeft", - type: "uint256", - }, - { - internalType: "uint8", - name: "_stageNumber", - type: "uint8", - }, - ], - name: "updateGrant", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - stateMutability: "payable", - type: "receive", - }, - ], - inheritedFunctions: { - DEFAULT_ADMIN_ROLE: "@openzeppelin/contracts/access/AccessControl.sol", - getRoleAdmin: "@openzeppelin/contracts/access/AccessControl.sol", - grantRole: "@openzeppelin/contracts/access/AccessControl.sol", - hasRole: "@openzeppelin/contracts/access/AccessControl.sol", - renounceRole: "@openzeppelin/contracts/access/AccessControl.sol", - revokeRole: "@openzeppelin/contracts/access/AccessControl.sol", - supportsInterface: "@openzeppelin/contracts/access/AccessControl.sol", - }, - }, - }, } as const; export default deployedContracts satisfies GenericContractsDeclaration;