diff --git a/.github/workflows/verifydeployed.yml b/.github/workflows/verifydeployed.yml new file mode 100644 index 000000000..8bae264e0 --- /dev/null +++ b/.github/workflows/verifydeployed.yml @@ -0,0 +1,66 @@ +name: Verify deployed contracts + +on: + workflow_dispatch: + inputs: + contracts: + description: 'List of deployed contracts to verify (space delimited)' + required: true + type: string + network: + description: 'Network where the contracts are deployed' + required: true + type: choice + default: mainnet + options: + - mainnet + - arbitrum-one + - goerli + - arbitrum-goerli + +jobs: + build: + name: Compile contracts + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16' + cache: 'yarn' + - run: yarn install --non-interactive --frozen-lockfile + + - name: Compile contracts + run: yarn build + + - name: Save build artifacts + uses: actions/upload-artifact@v3 + with: + name: contract-artifacts + path: | + build + cache/*.json + + verify: + name: Verify deployments + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16' + cache: 'yarn' + - run: yarn install --non-interactive --frozen-lockfile + - name: Get build artifacts + uses: actions/download-artifact@v3 + with: + name: contract-artifacts + + - name: Verify contracts on Defender + run: yarn hardhat --network ${{ inputs.network }} verify-defender ${{ inputs.contracts }} + env: + DEFENDER_API_KEY: "${{ secrets.DEFENDER_API_KEY }}" + DEFENDER_API_SECRET: "${{ secrets.DEFENDER_API_SECRET }}" + INFURA_KEY: "${{ secrets.INFURA_KEY }}" + WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/addresses.json b/addresses.json index 24307ea8d..5c06b2f84 100644 --- a/addresses.json +++ b/addresses.json @@ -301,6 +301,34 @@ "creationCodeHash": "0x8c9929ec6293458209f9cbadd96821604765e3656fe3c7b289b99194ede15336", "runtimeCodeHash": "0x6309a51754b6bec245685c7a81059dc28e3756f1045f18d059abc9294f454a6a", "txHash": "0x106c31f2c24a5285c47a766422823766f1c939034513e85613d70d99ef697173" + }, + "BridgeEscrow": { + "address": "0x36aFF7001294daE4C2ED4fDEfC478a00De77F090", + "initArgs": ["0x24CCD4D3Ac8529fF08c58F74ff6755036E616117"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x218aff2c804dd3dfe5064b08cab83ffb37382ca2aea1a225c2ead02ec99f38b5", + "proxy": true, + "implementation": { + "address": "0xBcD54513aa593646d72aEA31406c633C235Ad6EA", + "creationCodeHash": "0x6a1fc897c0130a1c99221cde1938d247de13a0861111ac47ad81c691f323df1a", + "runtimeCodeHash": "0xc8e31a4ebea0c3e43ceece974071ba0b6db2bed6725190795e07a2d369d2a8ab", + "txHash": "0x92908e33b54f59ec13a0f7bd29b818c421742294b9974d73859e0bde871bafb9" + } + }, + "L1GraphTokenGateway": { + "address": "0x01cDC91B0A9bA741903aA3699BF4CE31d6C5cC06", + "initArgs": ["0x24CCD4D3Ac8529fF08c58F74ff6755036E616117"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xd327568a286d6fcda1a6b78a14c87d660523a6900be901d6a7fbc2504faff64b", + "proxy": true, + "implementation": { + "address": "0x2bc65E92B68560851C225459a31Df6617448EC31", + "creationCodeHash": "0x67f10f3d0761db9c6c45ef15b19d7ffd56ca558767aa5b960ffaeec8aa607433", + "runtimeCodeHash": "0xbdb984007bd365bea1b1bee307eab5e40a9aa319c111fd7ccab29db30c19ae79", + "txHash": "0xe3b69f2bb04e430d23f73933b37a22d9edb651680cf2751221240afebc274ca1" + } } }, "5": { @@ -721,6 +749,216 @@ "txHash": "0xe3d870434e38ee37142a86e0fc54063df59c02c3b70135f070c3a1025c5e8246" } }, + "42161": { + "GraphProxyAdmin": { + "address": "0x2983936aC20202a6555993448E0d5654AC8Ca5fd", + "creationCodeHash": "0x68b304ac6bce7380d5e0f6b14a122f628bffebcc75f8205cb60f0baf578b79c3", + "runtimeCodeHash": "0x8d9ba87a745cf82ab407ebabe6c1490197084d320efb6c246d94bcc80e804417", + "txHash": "0x3ff82c38ec0e08e8f4194689188edcc1e8acb1f231c14cce8f0223f4dfc6cb76" + }, + "BancorFormula": { + "address": "0xA489FDc65229D6225014C0b357BCD19af6f00eE9", + "creationCodeHash": "0x7ae36017eddb326ddd79c7363781366121361d42fdb201cf57c57424eede46f4", + "runtimeCodeHash": "0xed6701e196ad93718e28c2a2a44d110d9e9906085bcfe4faf4f6604b08f0116c", + "txHash": "0xb2bb14ba3cbd1bb31b08b86aced469745f9888710254bb3baed047f435e788c0" + }, + "Controller": { + "address": "0x0a8491544221dd212964fbb96487467291b2C97e", + "creationCodeHash": "0x798f913fbaa1b2547c917e3dc31679089ab27cba442c511c159803acdba28c15", + "runtimeCodeHash": "0x00ae0824f79c4e48d2d23a8d4e6d075f04f44f3ea30a4f4305c345bb98117c62", + "txHash": "0x2a9d5744ad0e5e2e6bb6733ae890702fed2bce906e4e8b1cc50d2d3912c58d18" + }, + "EpochManager": { + "address": "0x5A843145c43d328B9bB7a4401d94918f131bB281", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e", "6646"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x4c70b8a56278452898d9eb23787a977d38141ebe48c79417c3acf6748ff921cf", + "proxy": true, + "implementation": { + "address": "0xeEDEdb3660154f439D93bfF612f7902edf07b848", + "creationCodeHash": "0x83bc0b08dbe1a9259666ec209f06223863f7bb9cfbf917a2d4b795c771a727fe", + "runtimeCodeHash": "0xed60261c6dc84ebc16830c36f3ee370a92802601d5a2fe1c3c19f5120dcbc2eb", + "txHash": "0x64fac1c567b7be735084b337a1e4ea9b990a8ffee8190485dc9b8dfcc257146c" + } + }, + "L2GraphToken": { + "address": "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "initArgs": ["0x4528FD7868c91Ef64B9907450Ee8d82dC639612c"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x8465190df853c05bbdec00ba6b66139be0e5663fd5b740bdd464ad7409ce2100", + "proxy": true, + "implementation": { + "address": "0xaFFCb96181D920FE8C0Af046C49B2c9eC98b28df", + "creationCodeHash": "0x6c4146427aafa7375a569154be95c8c931bf83aab0315706dd78bdf79c889e4c", + "runtimeCodeHash": "0x004371d1d80011906953dcba17c648503fc94b94e1e0365c8d8c706ff91f93e9", + "txHash": "0xbd7d146ce80831ed7643e9f5b5a84737da354994ae080cb3d7ff7bbc3e696b3d" + } + }, + "GraphCurationToken": { + "address": "0x47a0d56ea574419B524285d52fFe7198297D209c", + "creationCodeHash": "0x1ee42ee271cefe20c33c0de904501e618ac4b56debca67c634d0564cecea9ff2", + "runtimeCodeHash": "0x340e8f378c0117b300f3ec255bc5c3a273f9ab5bd2940fa8eb3b5065b21f86dc", + "txHash": "0x382568f1871a3d57f4d3787b255a2364e9926cb6770fdca3cde6cb04b577ecd5" + }, + "ServiceRegistry": { + "address": "0x072884c745c0A23144753335776c99BE22588f8A", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x54b1da3f2fdd2327abe01f75ac38a670ee16d3f47bc58641ddaef04f0b9d0f78", + "proxy": true, + "implementation": { + "address": "0xD32569dA3B89b040A0589B5b8D2c721a68472ff3", + "creationCodeHash": "0x50808e8cce93cf78a23c9e6dd7984356bd2bd93be30b358982909140dd61f6ff", + "runtimeCodeHash": "0xaef79c87f7e80107c0dc568cf1f8950459b5174ee3aa565ec487556a655e71db", + "txHash": "0xca363c6bc841b43bd896b6d2098434679884d200a28013dedb48a2c95028ce40" + } + }, + "Curation": { + "address": "0x22d78fb4bc72e191C765807f8891B5e1785C8014", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "0xA489FDc65229D6225014C0b357BCD19af6f00eE9", + "0x47a0d56ea574419B524285d52fFe7198297D209c", + "1000000", + "10000", + "1000000000000000000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x8f856e2090af3243349199f7991e01b1c28de7b70b0185d2370d8ada5ce9c97b", + "proxy": true, + "implementation": { + "address": "0x234071F4B1e322d1167D63503498f82cC7Fa4606", + "creationCodeHash": "0xa5fa77df71a72c5aadba812345978c291c5fa1a3a23129b6eba3a38ac85d8b5d", + "runtimeCodeHash": "0x1d265e9f658778b48a0247cfef79bfc9304d1faa1f1e085f2fea85629f68e2d5", + "txHash": "0x68d06c576b5bc472152f4ab4afa90e2c5832512fa83c69493be5da52b585f45c" + } + }, + "SubgraphNFTDescriptor": { + "address": "0x96cce9b6489744630A058324FB22e7CD02815ebe", + "creationCodeHash": "0xf16e8ff11d852eea165195ac9e0dfa00f98e48f6ce3c77c469c7df9bf195b651", + "runtimeCodeHash": "0x39583196f2bcb85789b6e64692d8c0aa56f001c46f0ca3d371abbba2c695860f", + "txHash": "0xbb01566726e1d58825cf7aa2860f0f571ff47f92b3837aad0e73e7791fbca48c" + }, + "SubgraphNFT": { + "address": "0x3FbD54f0cc17b7aE649008dEEA12ed7D2622B23f", + "constructorArgs": ["0x4528FD7868c91Ef64B9907450Ee8d82dC639612c"], + "creationCodeHash": "0xc1e58864302084de282dffe54c160e20dd96c6cfff45e00e6ebfc15e04136982", + "runtimeCodeHash": "0x7216e736a8a8754e88688fbf5c0c7e9caf35c55ecc3a0c5a597b951c56cf7458", + "txHash": "0x4334bd64938c1c5c604bde96467a8601875046569f738e6860851594c91681ff" + }, + "GNS": { + "address": "0xec9A7fb6CbC2E41926127929c2dcE6e9c5D33Bec", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "0xA489FDc65229D6225014C0b357BCD19af6f00eE9", + "0x3FbD54f0cc17b7aE649008dEEA12ed7D2622B23f" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xf7f2747d1aafd1684ffee7316e727475249cd358af559c6234089b72ffc25f5d", + "proxy": true, + "implementation": { + "address": "0x8Cab11d17082C67aFc3dc35D1a2E02B23dB914ab", + "creationCodeHash": "0xb0be24e926bb24420bb5a8d3f7bd0b70a545fdddbf8cb177a42478adf4435aae", + "runtimeCodeHash": "0x4cb62b9def5b691e43ed06808b18efe682fcefb7739909be0d6c87f1eda724cd", + "txHash": "0xb4bf3e0fdf9486ff24c567fecb90875a8d11efa1a1a4dba36f25d529c586852c" + } + }, + "Staking": { + "address": "0x00669A4CF01450B64E8A2A20E9b1FCB71E61eF03", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "100000000000000000000000", + "186092", + "10000", + "100000", + "7", + "28", + "28", + "16", + "77", + "100" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0xa33c0d58ddaed7e3f7381a33e3d5f63e39219863019f00d54ce2fd2446076ac7", + "proxy": true, + "implementation": { + "address": "0x2787f89355924a8781Acf988f12855C6CD495A06", + "creationCodeHash": "0xa4e467ac964866579894ebd6afae491e807a16969f9f1faa95707dc25d8d201c", + "runtimeCodeHash": "0x1880c562574956c097d7f6d8f09a91d76e50bf1babd71e369f032d4b0716f0f8", + "txHash": "0x3ed3b4744df380b7f87341839f16c19234a1565f56a8c672183396678f8390c4", + "libraries": { + "LibCobbDouglas": "0x86e80908F80B40B924966B781a8e20338670B431" + } + } + }, + "RewardsManager": { + "address": "0x971B9d3d0Ae3ECa029CAB5eA1fB0F72c85e6a525", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x222e14cb6f49e3e7b76f6a523c1a3c24f96402676be8662bf1b94bb2250ddd0f", + "proxy": true, + "implementation": { + "address": "0x225aB818cD003BB17728768e6a48c160d89C64d0", + "creationCodeHash": "0x98aaabec491a17401ca37209db0613c91285de061e859574526f841a4dd60c4a", + "runtimeCodeHash": "0x2795a83531898957014373bd4595f1f9a381ecfaf787bdfc64380563af06f06a", + "txHash": "0x6b6f45a955e114102874d34e31106ad00e04a9dba96515a9153d60539eb9208a" + } + }, + "DisputeManager": { + "address": "0x0Ab2B043138352413Bb02e67E626a70320E3BD46", + "initArgs": [ + "0x0a8491544221dd212964fbb96487467291b2C97e", + "0x113DC95e796836b8F0Fa71eE7fB42f221740c3B0", + "10000000000000000000000", + "500000", + "25000", + "25000" + ], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x68f08fe0a1179170c8b4c7542725d71432b4171604d7456dff824e0ec1c6cdb9", + "proxy": true, + "implementation": { + "address": "0x0E55B996EB7Bfc3175E883D02FF55a34f8C9986e", + "creationCodeHash": "0x2e77ad7a1627b6e04bece0fe18b3ab543ef4a2d6914f2e5e640b2c8175aca3a8", + "runtimeCodeHash": "0x0186afe711eff4ceea28620d091e3c6034fd15be05894119c74a38b020e3a554", + "txHash": "0xbb04391bd3353d6f2210e98ced779edcda954d971effcae7fd8676a94afa2655" + } + }, + "AllocationExchange": { + "address": "0x993F00C98D1678371a7b261Ed0E0D4b6F42d9aEE", + "constructorArgs": [ + "0x9623063377AD1B27544C965cCd7342f7EA7e88C7", + "0x00669A4CF01450B64E8A2A20E9b1FCB71E61eF03", + "0x270Ea4ea9e8A699f8fE54515E3Bb2c418952623b", + "0x79f2212de27912bCb25a452fC102C85c142E3eE3" + ], + "creationCodeHash": "0x96c5b59557c161d80f1617775a7b9537a89b0ecf2258598b3a37724be91ae80a", + "runtimeCodeHash": "0xc86fd1d67a0db0aed4cb310f977ebf3e70865e2095a167f4a103c3792146027c", + "txHash": "0x2bad6b8e5eda0026c8c38a70b925bbedd6a617a1e06952fb30e427fdbc592422" + }, + "L2GraphTokenGateway": { + "address": "0x65E1a5e8946e7E87d9774f5288f41c30a99fD302", + "initArgs": ["0x0a8491544221dd212964fbb96487467291b2C97e"], + "creationCodeHash": "0xcdd28bb3db05f1267ca0f5ea29536c61841be5937ce711b813924f8ff38918cc", + "runtimeCodeHash": "0x4ca8c37c807bdfda1d6dcf441324b7ea14c6ddec5db37c20c2bf05aeae49bc0d", + "txHash": "0x50816047ea926423ec02b6b89efb96efcd3d7e7028ea7cf82c3da9fd1bf3869e", + "proxy": true, + "implementation": { + "address": "0x6f37b2AF8A0Cc74f1bFddf2E9302Cb226710127F", + "creationCodeHash": "0xbd52455bd8b14bfc27af623388fe2f9e06ddd4c4be3fc06c51558a912de91770", + "runtimeCodeHash": "0x29e47f693053f978d6b2ac0a327319591bf5b5e8a6e6c0744b8afcc0250bf667", + "txHash": "0x0eaa9d03982b88e765262a15b95548cb688ce9337a48460f39e55f8850690cbe" + } + } + }, "421613": { "GraphProxyAdmin": { "address": "0x4037466bb242f51575d32E8B1be693b3E5Cd1386", diff --git a/cli/arbitrum.ts b/cli/arbitrum.ts new file mode 100644 index 000000000..727a19fa7 --- /dev/null +++ b/cli/arbitrum.ts @@ -0,0 +1,108 @@ +import { + L1ToL2MessageReader, + L1ToL2MessageStatus, + L1ToL2MessageWriter, + L1TransactionReceipt, + L2ToL1MessageReader, + L2ToL1MessageStatus, + L2ToL1MessageWriter, + L2TransactionReceipt, +} from '@arbitrum/sdk' +import { providers, Signer } from 'ethers' +import { Provider } from '@ethersproject/abstract-provider' + +// L1 -> L2 +export async function getL1ToL2MessageWriter( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, + signer: Signer, +): Promise { + return (await getL1ToL2Message( + txHashOrReceipt, + l1Provider, + l2Provider, + signer, + )) as L1ToL2MessageWriter +} + +export async function getL1ToL2MessageReader( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, +): Promise { + return await getL1ToL2Message(txHashOrReceipt, l1Provider, l2Provider) +} + +export async function getL1ToL2MessageStatus( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, +): Promise { + const message = await getL1ToL2Message(txHashOrReceipt, l1Provider, l2Provider) + return await message.status() +} + +async function getL1ToL2Message( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, + signer?: Signer, +): Promise { + const txReceipt = + typeof txHashOrReceipt === 'string' + ? await l1Provider.getTransactionReceipt(txHashOrReceipt) + : txHashOrReceipt + const l2SignerOrProvider = signer ? signer.connect(l2Provider) : l2Provider + const l1Receipt = new L1TransactionReceipt(txReceipt) + const l1ToL2Messages = await l1Receipt.getL1ToL2Messages(l2SignerOrProvider) + return l1ToL2Messages[0] +} + +// L2 -> L1 +export async function getL2ToL1MessageWriter( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, + signer: Signer, +): Promise { + return (await getL2ToL1Message( + txHashOrReceipt, + l1Provider, + l2Provider, + signer, + )) as L2ToL1MessageWriter +} + +export async function getL2ToL1MessageReader( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, +): Promise { + return await getL2ToL1Message(txHashOrReceipt, l1Provider, l2Provider) +} + +export async function getL2ToL1MessageStatus( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, +): Promise { + const message = await getL2ToL1Message(txHashOrReceipt, l1Provider, l2Provider) + return await message.status(l2Provider) +} + +async function getL2ToL1Message( + txHashOrReceipt: string | providers.TransactionReceipt, + l1Provider: Provider, + l2Provider: Provider, + signer?: Signer, +) { + const txReceipt = + typeof txHashOrReceipt === 'string' + ? await l2Provider.getTransactionReceipt(txHashOrReceipt) + : txHashOrReceipt + const l1SignerOrProvider = signer ? signer.connect(l1Provider) : l1Provider + const l2Receipt = new L2TransactionReceipt(txReceipt) + const l2ToL1Messages = await l2Receipt.getL2ToL1Messages(l1SignerOrProvider) + return l2ToL1Messages[0] +} diff --git a/cli/commands/bridge/to-l1.ts b/cli/commands/bridge/to-l1.ts index 0913aa2e1..93c6b1f53 100644 --- a/cli/commands/bridge/to-l1.ts +++ b/cli/commands/bridge/to-l1.ts @@ -10,6 +10,7 @@ import { BigNumber } from 'ethers' import { JsonRpcProvider } from '@ethersproject/providers' import { providers } from 'ethers' import { L2GraphToken } from '../../../build/types/L2GraphToken' +import { getL2ToL1MessageReader, getL2ToL1MessageWriter } from '../../arbitrum' const FOURTEEN_DAYS_IN_SECONDS = 24 * 3600 * 14 @@ -99,10 +100,11 @@ export const startSendToL1 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Prom 'outboundTransfer(address,address,uint256,bytes)', params, ) + + const l2ToL1Message = await getL2ToL1MessageReader(receipt, cli.wallet.provider, l2Provider) const l2Receipt = new L2TransactionReceipt(receipt) - const l2ToL1Message = (await l2Receipt.getL2ToL1Messages(cli.wallet))[0] - const ethBlockNum = l2ToL1Message.getFirstExecutableBlock(l2Provider) + const ethBlockNum = await l2ToL1Message.getFirstExecutableBlock(l2Provider) if (ethBlockNum === null) { logger.info(`L2 to L1 message can or already has been executed. If not finalized call`) } else { @@ -157,11 +159,12 @@ export const finishSendToL1 = async ( txHash = allEvents[allEvents.length - 1].transactionHash } logger.info(`Getting receipt from transaction ${txHash}`) - const receipt = await l2Provider.getTransactionReceipt(txHash) - - const l2Receipt = new L2TransactionReceipt(receipt) - logger.info(`Getting L2 to L1 message...`) - const l2ToL1Message = (await l2Receipt.getL2ToL1Messages(cli.wallet))[0] + const l2ToL1Message = await getL2ToL1MessageWriter( + txHash, + cli.wallet.provider, + l2Provider, + cli.wallet, + ) if (wait) { const retryDelayMs = cliArgs.retryDelaySeconds ? cliArgs.retryDelaySeconds * 1000 : 60000 diff --git a/cli/commands/bridge/to-l2.ts b/cli/commands/bridge/to-l2.ts index 01b3f65bc..b7d64795a 100644 --- a/cli/commands/bridge/to-l2.ts +++ b/cli/commands/bridge/to-l2.ts @@ -6,6 +6,7 @@ import { loadEnv, CLIArgs, CLIEnvironment } from '../../env' import { logger } from '../../logging' import { getProvider, sendTransaction, toGRT, ensureAllowance, toBN } from '../../network' import { chainIdIsL2, estimateRetryableTxGas } from '../../cross-chain' +import { getL1ToL2MessageWriter } from '../../arbitrum' const logAutoRedeemReason = (autoRedeemRec) => { if (autoRedeemRec == null) { @@ -40,6 +41,8 @@ const checkAndRedeemMessage = async (l1ToL2Message: L1ToL2MessageWriter) => { logger.info(`Transfer successful: ${l2TxHash}`) } +const ifNotNullToBN = (val: string | null) => (val == null ? val : toBN(val)) + export const sendToL2 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { logger.info(`>>> Sending tokens to L2 <<<\n`) @@ -105,9 +108,12 @@ export const sendToL2 = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise => { diff --git a/config/graph.goerli.yml b/config/graph.goerli.yml index b4b735b4e..36edf25ea 100644 --- a/config/graph.goerli.yml +++ b/config/graph.goerli.yml @@ -131,8 +131,8 @@ contracts: init: controller: "${{Controller.address}}" calls: - - fn: "setIssuanceRate" - issuanceRate: "1000000012184945188" # per block increase of total supply, blocks in a year = 365*60*60*24/13 + - fn: "setIssuancePerBlock" + issuancePerBlock: "114155251141552511415" # per block increase of total supply, blocks in a year = 365*60*60*24/12 - fn: "setSubgraphAvailabilityOracle" subgraphAvailabilityOracle: *availabilityOracle - fn: "syncAllContracts" diff --git a/hardhat.config.ts b/hardhat.config.ts index 3b989dcd0..4c9c557a3 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -19,6 +19,7 @@ import 'hardhat-contract-sizer' import 'hardhat-tracer' import '@tenderly/hardhat-tenderly' import '@openzeppelin/hardhat-upgrades' +import '@openzeppelin/hardhat-defender' import '@typechain/hardhat' import 'solidity-coverage' import 'hardhat-storage-layout' @@ -202,13 +203,17 @@ const config: HardhatUserConfig = { }, tenderly: { project: 'graph-network', - username: 'abarmat', + username: 'graphprotocol', }, contractSizer: { alphaSort: true, runOnCompile: false, disambiguatePaths: false, }, + defender: { + apiKey: process.env.DEFENDER_API_KEY!, + apiSecret: process.env.DEFENDER_API_SECRET!, + }, } setupNetworkProviders(config) diff --git a/package.json b/package.json index ef123981e..8c14f97ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/contracts", - "version": "2.0.0", + "version": "2.1.0", "description": "Contracts for the Graph Protocol", "directories": { "test": "test" @@ -12,6 +12,7 @@ "addresses.json" ], "dependencies": { + "console-table-printer": "^2.11.1", "ethers": "^5.6.0" }, "devDependencies": { @@ -26,6 +27,7 @@ "@nomiclabs/hardhat-waffle": "^2.0.1", "@openzeppelin/contracts": "^3.4.1", "@openzeppelin/contracts-upgradeable": "3.4.2", + "@openzeppelin/hardhat-defender": "^1.8.1", "@openzeppelin/hardhat-upgrades": "^1.6.0", "@tenderly/hardhat-tenderly": "^1.0.11", "@typechain/ethers-v5": "^7.0.0", diff --git a/tasks/bridge/deposits.ts b/tasks/bridge/deposits.ts new file mode 100644 index 000000000..3af628caf --- /dev/null +++ b/tasks/bridge/deposits.ts @@ -0,0 +1,97 @@ +import { task } from 'hardhat/config' +import { cliOpts } from '../../cli/defaults' +import { ethers } from 'ethers' +import { Table } from 'console-table-printer' +import { L1ToL2MessageStatus } from '@arbitrum/sdk' +import { getL1ToL2MessageStatus } from '../../cli/arbitrum' + +export const TASK_BRIDGE_DEPOSITS = 'bridge:deposits' + +task(TASK_BRIDGE_DEPOSITS, 'List deposits initiated on L1GraphTokenGateway') + .addOptionalParam('addressBook', cliOpts.addressBook.description) + .addOptionalParam( + 'arbitrumAddressBook', + cliOpts.arbitrumAddressBook.description, + cliOpts.arbitrumAddressBook.default, + ) + .addOptionalParam('l1GraphConfig', cliOpts.graphConfig.description) + .addOptionalParam('l2GraphConfig', cliOpts.graphConfig.description) + .addOptionalParam('startBlock', 'Start block for the search') + .addOptionalParam('endBlock', 'End block for the search') + .setAction(async (taskArgs, hre) => { + console.log('> L1GraphTokenGateway deposits') + + const graph = hre.graph(taskArgs) + const gateway = graph.l1.contracts.L1GraphTokenGateway + console.log(`Tracking 'DepositInitiated' events on ${gateway.address}`) + + const startBlock = taskArgs.startBlock ? parseInt(taskArgs.startBlock) : 0 + const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' + console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + + const events = await Promise.all( + ( + await gateway.queryFilter(gateway.filters.DepositInitiated(), startBlock, endBlock) + ).map(async (e) => ({ + blockNumber: `${e.blockNumber} (${new Date( + (await graph.l1.provider.getBlock(e.blockNumber)).timestamp * 1000, + ).toLocaleString()})`, + tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, + amount: ethers.utils.formatEther(e.args.amount), + status: emojifyRetryableStatus( + await getL1ToL2MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), + ), + })), + ) + + const total = events.reduce( + (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), + ethers.BigNumber.from(0), + ) + console.log( + `Found ${events.length} deposits with a total of ${ethers.utils.formatEther(total)} GRT`, + ) + + console.log( + 'L1 to L2 message status reference: 🚧 = not yet created, ❌ = creation failed, ⚠️ = funds deposited on L2, ✅ = redeemed, ⌛ = expired', + ) + + printEvents(events) + }) + +function printEvents(events: any[]) { + const tablePrinter = new Table({ + charLength: { '🚧': 2, '✅': 2, '⚠️': 1, '⌛': 2, '❌': 2 }, + columns: [ + { name: 'status', color: 'green', alignment: 'center' }, + { name: 'blockNumber', color: 'green', alignment: 'center' }, + { + name: 'tx', + color: 'green', + alignment: 'center', + maxLen: 88, + }, + { name: 'amount', color: 'green', alignment: 'center' }, + ], + }) + + events.map((e) => tablePrinter.addRow(e)) + tablePrinter.printTable() +} + +function emojifyRetryableStatus(status: L1ToL2MessageStatus): string { + switch (status) { + case L1ToL2MessageStatus.NOT_YET_CREATED: + return '🚧' + case L1ToL2MessageStatus.CREATION_FAILED: + return '❌' + case L1ToL2MessageStatus.FUNDS_DEPOSITED_ON_L2: + return '⚠️ ' + case L1ToL2MessageStatus.REDEEMED: + return '✅' + case L1ToL2MessageStatus.EXPIRED: + return '⌛' + default: + return '❌' + } +} diff --git a/tasks/bridge/withdrawals.ts b/tasks/bridge/withdrawals.ts new file mode 100644 index 000000000..ea1cb402a --- /dev/null +++ b/tasks/bridge/withdrawals.ts @@ -0,0 +1,93 @@ +import { task } from 'hardhat/config' +import { cliOpts } from '../../cli/defaults' +import { ethers } from 'ethers' +import { Table } from 'console-table-printer' +import { L2ToL1MessageStatus } from '@arbitrum/sdk' +import { getL2ToL1MessageStatus } from '../../cli/arbitrum' + +export const TASK_BRIDGE_WITHDRAWALS = 'bridge:withdrawals' + +task(TASK_BRIDGE_WITHDRAWALS, 'List withdrawals initiated on L2GraphTokenGateway') + .addOptionalParam('addressBook', cliOpts.addressBook.description) + .addOptionalParam( + 'arbitrumAddressBook', + cliOpts.arbitrumAddressBook.description, + cliOpts.arbitrumAddressBook.default, + ) + .addOptionalParam('l1GraphConfig', cliOpts.graphConfig.description) + .addOptionalParam('l2GraphConfig', cliOpts.graphConfig.description) + .addOptionalParam('startBlock', 'Start block for the search') + .addOptionalParam('endBlock', 'End block for the search') + .setAction(async (taskArgs, hre) => { + console.log('> L2GraphTokenGateway withdrawals') + + const graph = hre.graph(taskArgs) + const gateway = graph.l2.contracts.L2GraphTokenGateway + console.log(`Tracking 'WithdrawalInitiated' events on ${gateway.address}`) + + const startBlock = taskArgs.startBlock ? parseInt(taskArgs.startBlock) : 0 + const endBlock = taskArgs.endBlock ? parseInt(taskArgs.endBlock) : 'latest' + console.log(`Searching blocks from block ${startBlock} to block ${endBlock}`) + + const events = await Promise.all( + ( + await gateway.queryFilter(gateway.filters.WithdrawalInitiated(), startBlock, endBlock) + ).map(async (e) => ({ + blockNumber: `${e.blockNumber} (${new Date( + (await graph.l2.provider.getBlock(e.blockNumber)).timestamp * 1000, + ).toLocaleString()})`, + tx: `${e.transactionHash} ${e.args.from} -> ${e.args.to}`, + amount: ethers.utils.formatEther(e.args.amount), + status: emojifyL2ToL1Status( + await getL2ToL1MessageStatus(e.transactionHash, graph.l1.provider, graph.l2.provider), + ), + })), + ) + + const total = events.reduce( + (acc, e) => acc.add(ethers.utils.parseEther(e.amount)), + ethers.BigNumber.from(0), + ) + console.log( + `Found ${events.length} withdrawals for a total of ${ethers.utils.formatEther(total)} GRT`, + ) + + console.log( + 'L2 to L1 message status reference: 🚧 = unconfirmed, ⚠️ = confirmed, ✅ = executed', + ) + + printEvents(events) + }) + +function printEvents(events: any[]) { + const tablePrinter = new Table({ + charLength: { '🚧': 2, '✅': 2, '⚠️': 1, '❌': 2 }, + columns: [ + { name: 'status', color: 'green', alignment: 'center' }, + { name: 'blockNumber', color: 'green' }, + { + name: 'tx', + color: 'green', + alignment: 'center', + maxLen: 88, + }, + { name: 'amount', color: 'green' }, + ], + }) + + events.map((e) => tablePrinter.addRow(e)) + tablePrinter.printTable() +} + +function emojifyL2ToL1Status(status: L2ToL1MessageStatus): string { + switch (status) { + case L2ToL1MessageStatus.UNCONFIRMED: + return '🚧' + case L2ToL1MessageStatus.CONFIRMED: + return '⚠️ ' + case L2ToL1MessageStatus.EXECUTED: + return '✅' + default: + return '❌' + } +} diff --git a/tasks/verify/defender.ts b/tasks/verify/defender.ts new file mode 100644 index 000000000..bd2c17b7c --- /dev/null +++ b/tasks/verify/defender.ts @@ -0,0 +1,102 @@ +import { execSync } from 'child_process' +import { task } from 'hardhat/config' +import { HardhatRuntimeEnvironment as HRE } from 'hardhat/types' +import { constants } from 'ethers' +import { appendFileSync } from 'fs' +import type { VerificationResponse } from '@openzeppelin/hardhat-defender/dist/verify-deployment' + +async function main(args: { referenceUrl?: string; contracts: string[] }, hre: HRE) { + const { referenceUrl, contracts } = args + const { defender, network, graph } = hre + const summaryPath = process.env.GITHUB_STEP_SUMMARY + if (summaryPath) appendFileSync(summaryPath, `# Contracts deployment verification\n\n`) + + const workflowUrl = + referenceUrl || + process.env.WORKFLOW_URL || + execSync(`git config --get remote.origin.url`).toString().trim() + const addressBook = graph().addressBook + const errs = [] + + for (const contractName of contracts) { + const entry = addressBook.getEntry(contractName) + if (!entry || entry.address === constants.AddressZero) { + errs.push([contractName, { message: `Entry not found on address book.` }]) + continue + } + + const addressToVerify = entry.implementation?.address ?? entry.address + console.error(`Verifying artifact for ${contractName} at ${addressToVerify}`) + + try { + const response = await defender.verifyDeployment(addressToVerify, contractName, workflowUrl) + console.error(`Bytecode match for ${contractName} is ${response.matchType}`) + if (summaryPath) { + appendFileSync( + summaryPath, + `- ${contractName} at ${etherscanLink(network.name, addressToVerify)} is ${ + response.matchType + } ${emojiForMatch(response.matchType)}\n`, + ) + } + if (response.matchType === 'NO_MATCH') { + errs.push([contractName, { message: `No bytecode match.` }]) + } + } catch (err: any) { + if (summaryPath) { + appendFileSync( + summaryPath, + `- ${contractName} at ${etherscanLink( + network.name, + addressToVerify, + )} failed to verify :x:\n`, + ) + } + console.error(`Error verifying artifact: ${err.message}`) + errs.push([contractName, err]) + } + } + + if (errs.length > 0) { + throw new Error( + `Some verifications failed:\n${errs + .map(([name, err]) => ` ${name}: ${err.message}`) + .join('\n')}`, + ) + } +} + +function etherscanLink(network: string, address: string): string { + switch (network) { + case 'mainnet': + return `[\`${address}\`](https://etherscan.io/address/${address})` + case 'arbitrum-one': + return `[\`${address}\`](https://arbiscan.io/address/${address})` + case 'goerli': + return `[\`${address}\`](https://goerli.etherscan.io/address/${address})` + case 'arbitrum-goerli': + return `[\`${address}\`](https://goerli.arbiscan.io/address/${address})` + default: + return `\`${address}\`` + } +} + +function emojiForMatch(matchType: VerificationResponse['matchType']): string { + switch (matchType) { + case 'EXACT': + return ':heavy_check_mark:' + case 'PARTIAL': + return ':warning:' + case 'NO_MATCH': + return ':x:' + } +} + +task('verify-defender') + .addVariadicPositionalParam('contracts', 'List of contracts to verify') + .addOptionalParam( + 'referenceUrl', + 'URL to link to for artifact verification (defaults to $WORKFLOW_URL or the remote.origin.url of the repository)', + ) + .setDescription('Verifies deployed implementations on Defender') + .setAction(main) diff --git a/yarn.lock b/yarn.lock index 42084d9cd..01a128b4c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1006,6 +1006,26 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2.tgz#d81f786fda2871d1eb8a8c5a73e455753ba53527" integrity sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA== +"@openzeppelin/hardhat-defender@^1.8.1": + version "1.8.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-defender/-/hardhat-defender-1.8.1.tgz#d2527cc7898f76cf45ba51b0aaa40075ef742b52" + integrity sha512-vXfNSteO4xi8iGe/CRU5en2t6sbH8T4dIhrhZLa3TYke7LUt5du4GPFv74Kie+KIynPzAeVNEdW9suqDZNLYwA== + dependencies: + "@openzeppelin/hardhat-upgrades" "^1.20.0" + defender-admin-client "^1.29.0-rc.1" + defender-base-client "^1.3.1" + ethereumjs-util "^7.1.5" + +"@openzeppelin/hardhat-upgrades@^1.20.0": + version "1.21.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.21.0.tgz#e90fb7d858093f35a300b3a5a2fd32bca6179dfc" + integrity sha512-Kwl7IN0Hlhj4HluMTTl0DrtU90OI/Q6rG3sAyd2pv3fababe9EuZqs9DydOlkWM45JwTzC+eBzX3TgHsqI13eA== + dependencies: + "@openzeppelin/upgrades-core" "^1.20.0" + chalk "^4.1.0" + debug "^4.1.1" + proper-lockfile "^4.1.1" + "@openzeppelin/hardhat-upgrades@^1.6.0": version "1.17.0" resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.17.0.tgz#24ea0f366c3b2df985263cf8b1b796afd04d7e13" @@ -1029,6 +1049,19 @@ proper-lockfile "^4.1.1" solidity-ast "^0.4.15" +"@openzeppelin/upgrades-core@^1.20.0": + version "1.20.5" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.20.5.tgz#1650b7805a847a5ccc097cd676ec12316a5a4b8d" + integrity sha512-Wp4uUov9/8cY0H4xHYsGCkLh0EItrpusSdQPWOTI1Q/YDDfu4uTH3LYyTeVAavzEvkAuKCCuTOPnZBibLZGxSw== + dependencies: + cbor "^8.0.0" + chalk "^4.1.0" + compare-versions "^5.0.0" + debug "^4.1.1" + ethereumjs-util "^7.0.3" + proper-lockfile "^4.1.1" + solidity-ast "^0.4.15" + "@resolver-engine/core@^0.3.3": version "0.3.3" resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" @@ -1799,6 +1832,17 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" +amazon-cognito-identity-js@^4.3.3: + version "4.6.3" + resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-4.6.3.tgz#889410379a5fc5e883edc95f4ce233cc628e354c" + integrity sha512-MPVJfirbdmSGo7l4h7Kbn3ms1eJXT5Xq8ly+mCPPi8yAxaxdg7ouMUUNTqtDykoZxIdDLF/P6F3Zbg3dlGKOWg== + dependencies: + buffer "4.9.2" + crypto-js "^4.0.0" + fast-base64-decode "^1.0.0" + isomorphic-unfetch "^3.0.0" + js-cookie "^2.2.1" + amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -2042,6 +2086,13 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== + dependencies: + retry "0.13.1" + async@1.x, async@^1.4.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -2101,7 +2152,7 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -axios@^0.21.1: +axios@^0.21.1, axios@^0.21.2: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== @@ -2646,7 +2697,7 @@ base-x@^3.0.2, base-x@^3.0.6, base-x@^3.0.8: dependencies: safe-buffer "^5.0.1" -base64-js@^1.3.1: +base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -2971,6 +3022,15 @@ buffer-xor@^2.0.1: dependencies: safe-buffer "^5.1.1" +buffer@4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + buffer@^5.0.5, buffer@^5.2.1, buffer@^5.4.3, buffer@^5.5.0, buffer@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -3524,6 +3584,11 @@ compare-versions@^4.0.0: resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-4.1.3.tgz#8f7b8966aef7dc4282b45dfa6be98434fc18a1a4" integrity sha512-WQfnbDcrYnGr55UwbxKiQKASnTtNnaAWVi8jZyy8NTpVAXWACSne8lMD1iaIo9AiU6mnuLvSVshCzewVuWxHUg== +compare-versions@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-5.0.1.tgz#14c6008436d994c3787aba38d4087fabe858555e" + integrity sha512-v8Au3l0b+Nwkp4G142JcgJFh1/TUhdxut7wzD1Nq1dyp5oa3tXaqb03EXOAB6jS4gMlalkjAUPZBMiAfKUixHQ== + component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -3544,6 +3609,13 @@ concat-stream@^1.5.1, concat-stream@^1.6.0, concat-stream@^1.6.2: readable-stream "^2.2.2" typedarray "^0.0.6" +console-table-printer@^2.11.1: + version "2.11.1" + resolved "https://registry.yarnpkg.com/console-table-printer/-/console-table-printer-2.11.1.tgz#c2dfe56e6343ea5bcfa3701a4be29fe912dbd9c7" + integrity sha512-8LfFpbF/BczoxPwo2oltto5bph8bJkGOATXsg3E9ddMJOGnWJciKHldx2zDj5XIBflaKzPfVCjOTl6tMh7lErg== + dependencies: + simple-wcswidth "^1.0.1" + console-table-printer@^2.9.0: version "2.11.0" resolved "https://registry.yarnpkg.com/console-table-printer/-/console-table-printer-2.11.0.tgz#704a74cb56d66267a2527f500fedcaa78ca76259" @@ -3775,6 +3847,11 @@ crypto-browserify@3.12.0: randombytes "^2.0.0" randomfill "^1.0.3" +crypto-js@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" + integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -3854,9 +3931,9 @@ decamelize@^4.0.0: integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og== + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" @@ -3901,6 +3978,27 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +defender-admin-client@^1.29.0-rc.1: + version "1.37.0" + resolved "https://registry.yarnpkg.com/defender-admin-client/-/defender-admin-client-1.37.0.tgz#d4b6cc6c7ebaa9aab138f39b10572018c25dc9a1" + integrity sha512-0I0n+LUo4X75uiy/Sd5V5Qv1HwhmIvC++uswxx8xnQ0VUK+y0ic0uMk/8ACrItH/9EGH2YrURNm8ZGg9AY1K5A== + dependencies: + axios "^0.21.2" + defender-base-client "1.37.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + +defender-base-client@1.37.0, defender-base-client@^1.3.1: + version "1.37.0" + resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.37.0.tgz#22f63357ac99c2c8f64eab6e52c99ef113c62d3a" + integrity sha512-V6tU0q8/n1/m/edT2FlTvUmZn6u5/A64FqYQfrMgg4PEy1TvYCz9tF+3dnGjk+sJrzICAv0GQWwLw/+8uRq2mg== + dependencies: + amazon-cognito-identity-js "^4.3.3" + async-retry "^1.3.3" + axios "^0.21.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + defer-to-connect@^1.0.1: version "1.1.3" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" @@ -5254,6 +5352,11 @@ fake-merkle-patricia-tree@^1.0.1: dependencies: checkpoint-store "^1.1.0" +fast-base64-decode@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" + integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q== + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -6465,7 +6568,7 @@ idna-uts46-hx@^2.3.1: dependencies: punycode "2.1.0" -ieee754@^1.1.13: +ieee754@^1.1.13, ieee754@^1.1.4: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== @@ -7127,7 +7230,7 @@ isarray@0.0.1: resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== @@ -7167,6 +7270,14 @@ isomorphic-fetch@^3.0.0: node-fetch "^2.6.1" whatwg-fetch "^3.4.1" +isomorphic-unfetch@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" + integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== + dependencies: + node-fetch "^2.6.1" + unfetch "^4.2.0" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -7253,6 +7364,11 @@ it-to-stream@^0.1.1: p-fifo "^1.0.0" readable-stream "^3.6.0" +js-cookie@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + js-sha3@0.5.7, js-sha3@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" @@ -8429,9 +8545,9 @@ mock-fs@^4.1.0: integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== moment-timezone@^0.5.34: - version "0.5.34" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.34.tgz#a75938f7476b88f155d3504a9343f7519d9a405c" - integrity sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg== + version "0.5.37" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.37.tgz#adf97f719c4e458fdb12e2b4e87b8bec9f4eef1e" + integrity sha512-uEDzDNFhfaywRl+vwXxffjjq1q0Vzr+fcQpQ1bU0kbzorfS7zVtZnCnGc8mhWmF39d4g4YriF6kwA75mJKE/Zg== dependencies: moment ">= 2.9.0" @@ -10251,6 +10367,11 @@ retry-as-promised@^5.0.0: resolved "https://registry.yarnpkg.com/retry-as-promised/-/retry-as-promised-5.0.0.tgz#f4ecc25133603a2d2a7aff4a128691d7bc506d54" integrity sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA== +retry@0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" @@ -11835,9 +11956,14 @@ undici@^4.14.1: integrity sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw== undici@^5.4.0: - version "5.8.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.8.0.tgz#dec9a8ccd90e5a1d81d43c0eab6503146d649a4f" - integrity sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q== + version "5.9.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.9.1.tgz#fc9fd85dd488f965f153314a63d9426a11f3360b" + integrity sha512-6fB3a+SNnWEm4CJbgo0/CWR8RGcOCQP68SF4X0mxtYTq2VNN8T88NYrWVBAeSX+zb7bny2dx2iYhP3XHi00omg== + +unfetch@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" + integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== union-value@^1.0.0: version "1.0.1"