From a117702648fa1bf8e7d26364220760abbee95ce4 Mon Sep 17 00:00:00 2001 From: Jacob Homanics Date: Sat, 18 May 2024 01:20:52 -0500 Subject: [PATCH] migrated se-2 - 5/18/24 --- .github/workflows/lint.yaml | 18 +- .gitignore | 18 +- .vercelignore | 65 + README.md | 3 +- package.json | 16 +- packages/foundry/._.prettier.json | Bin 0 -> 4096 bytes packages/foundry/.prettier.json | 6 + .../11155111/run-1708664995.json | 401 -- .../11155111/run-1708665001.json | 1060 ------ .../DeployDemo.s.sol/11155111/run-latest.json | 1060 ------ packages/foundry/deployments/11155111.json | 3 - packages/foundry/foundry.toml | 13 +- .../lib/forge-std/.github/workflows/ci.yml | 18 +- .../lib/forge-std/.github/workflows/sync.yml | 4 +- packages/foundry/lib/forge-std/.gitmodules | 3 - packages/foundry/lib/forge-std/README.md | 2 +- packages/foundry/lib/forge-std/foundry.toml | 6 +- .../lib/ds-test/.github/workflows/build.yml | 41 - .../lib/forge-std/lib/ds-test/.gitignore | 4 - .../foundry/lib/forge-std/lib/ds-test/LICENSE | 674 ---- .../lib/forge-std/lib/ds-test/Makefile | 14 - .../lib/forge-std/lib/ds-test/default.nix | 4 - .../lib/forge-std/lib/ds-test/demo/demo.sol | 222 -- .../lib/forge-std/lib/ds-test/package.json | 15 - .../lib/forge-std/lib/ds-test/src/test.sol | 592 --- .../lib/forge-std/lib/ds-test/src/test.t.sol | 417 --- packages/foundry/lib/forge-std/package.json | 2 +- packages/foundry/lib/forge-std/scripts/vm.py | 2 +- .../lib/forge-std/src/StdAssertions.sol | 743 ++-- .../foundry/lib/forge-std/src/StdChains.sol | 18 +- .../lib/forge-std/src/StdInvariant.sol | 12 +- .../foundry/lib/forge-std/src/StdJson.sol | 18 +- .../foundry/lib/forge-std/src/StdStorage.sol | 307 +- .../foundry/lib/forge-std/src/StdToml.sol | 179 + .../foundry/lib/forge-std/src/StdUtils.sol | 2 +- packages/foundry/lib/forge-std/src/Test.sol | 8 +- packages/foundry/lib/forge-std/src/Vm.sol | 651 +++- .../lib/forge-std/src/mocks/MockERC20.sol | 84 +- .../lib/forge-std/src/mocks/MockERC721.sol | 78 +- .../lib/forge-std/test/StdAssertions.t.sol | 948 +---- .../lib/forge-std/test/StdChains.t.sol | 57 +- .../lib/forge-std/test/StdCheats.t.sol | 30 +- .../foundry/lib/forge-std/test/StdJson.t.sol | 49 + .../foundry/lib/forge-std/test/StdMath.t.sol | 16 +- .../lib/forge-std/test/StdStorage.t.sol | 170 +- .../foundry/lib/forge-std/test/StdToml.t.sol | 49 + .../foundry/lib/forge-std/test/StdUtils.t.sol | 36 +- packages/foundry/lib/forge-std/test/Vm.t.sol | 6 +- .../lib/forge-std/test/fixtures/test.json | 8 + .../lib/forge-std/test/fixtures/test.toml | 6 + .../lib/forge-std/test/mocks/MockERC20.t.sol | 2 +- .../lib/forge-std/test/mocks/MockERC721.t.sol | 2 +- .../lib/openzeppelin-contracts/CHANGELOG.md | 4 + .../lib/openzeppelin-contracts/README.md | 2 +- .../contracts/access/README.adoc | 4 +- .../contracts/governance/README.adoc | 4 + .../contracts/metatx/README.adoc | 5 + .../contracts/mocks/Base64Dirty.sol | 19 + .../contracts/package.json | 2 +- .../contracts/utils/Base64.sol | 29 +- .../contracts/utils/README.adoc | 28 +- .../openzeppelin-contracts/package-lock.json | 4 +- .../lib/openzeppelin-contracts/package.json | 2 +- .../test/utils/Base64.test.js | 12 +- packages/foundry/package.json | 4 +- packages/foundry/script/DeployHelpers.s.sol | 4 +- packages/foundry/script/VerifyAll.s.sol | 45 +- packages/foundry/script/generateTsAbis.js | 3 +- packages/nextjs/.gitignore | 5 +- .../_components/AddressCodeTab.tsx | 4 +- .../blockexplorer/_components/SearchBar.tsx | 2 +- .../blockexplorer/address/[address]/page.tsx | 11 +- packages/nextjs/app/blockexplorer/page.tsx | 51 +- .../transaction/[txHash]/page.tsx | 151 +- .../_components/TransactionComp.tsx | 148 + .../debug/_components/contract/ContractUI.tsx | 1 + .../_components/contract/DisplayVariable.tsx | 22 +- .../contract/ReadOnlyFunctionForm.tsx | 23 +- .../contract/WriteOnlyFunctionForm.tsx | 38 +- packages/nextjs/app/hats/_components/Hats.tsx | 52 +- packages/nextjs/app/layout.tsx | 43 +- .../_components/RepTokensDemo.tsx | 10 +- packages/nextjs/components/Footer.tsx | 17 +- packages/nextjs/components/Header.tsx | 25 +- .../ScaffoldEthAppWithProviders.tsx | 33 +- packages/nextjs/components/SwitchTheme.tsx | 10 +- .../components/rep-tokens/hooks/Hooks.tsx | 12 +- .../components/scaffold-eth/Address.tsx | 13 +- .../components/scaffold-eth/Balance.tsx | 21 +- .../nextjs/components/scaffold-eth/Faucet.tsx | 11 +- .../components/scaffold-eth/FaucetButton.tsx | 16 +- .../scaffold-eth/Input/AddressInput.tsx | 60 +- .../scaffold-eth/Input/InputBase.tsx | 19 +- .../AddressInfoDropdown.tsx | 15 +- .../AddressQRCodeModal.tsx | 2 +- .../NetworkOptions.tsx | 8 +- .../RainbowKitCustomConnectButton/index.tsx | 3 +- .../nextjs/contracts/deployedContracts.ts | 31 +- .../nextjs/contracts/externalContracts.ts | 1005 +---- packages/nextjs/hooks/scaffold-eth/index.ts | 14 +- .../hooks/scaffold-eth/useAccountBalance.ts | 36 - .../hooks/scaffold-eth/useAutoConnect.ts | 82 - .../hooks/scaffold-eth/useBurnerWallet.ts | 13 +- .../hooks/scaffold-eth/useContractLogs.ts | 9 +- .../scaffold-eth/useDeployedContractInfo.ts | 6 +- .../hooks/scaffold-eth/useScaffoldContract.ts | 30 +- .../scaffold-eth/useScaffoldContractWrite.ts | 103 - .../scaffold-eth/useScaffoldEventHistory.ts | 156 +- ...ractRead.ts => useScaffoldReadContract.ts} | 47 +- ...er.ts => useScaffoldWatchContractEvent.ts} | 15 +- .../scaffold-eth/useScaffoldWriteContract.ts | 130 + .../hooks/scaffold-eth/useTargetNetwork.ts | 4 +- .../hooks/scaffold-eth/useTransactor.tsx | 29 +- .../hooks/scaffold-eth/useWatchBalance.ts | 21 + packages/nextjs/package.json | 12 +- packages/nextjs/public/logo-transparent.png | Bin 85402 -> 0 bytes packages/nextjs/public/logo.png | Bin 15869 -> 0 bytes packages/nextjs/public/manifest.json | 6 +- packages/nextjs/scaffold.config.ts | 8 - .../web3/wagmi-burner/BurnerConnector.ts | 155 - .../wagmi-burner/BurnerConnectorErrors.ts | 23 - .../web3/wagmi-burner/BurnerConnectorTypes.ts | 10 - .../web3/wagmi-burner/burnerWalletConfig.ts | 39 - packages/nextjs/services/web3/wagmiConfig.tsx | 28 +- .../nextjs/services/web3/wagmiConnectors.tsx | 75 +- packages/nextjs/tailwind.config.js | 1 + packages/nextjs/types/abitype/abi.d.ts | 12 +- packages/nextjs/utils/scaffold-eth/common.ts | 4 + .../nextjs/utils/scaffold-eth/contract.ts | 50 +- .../nextjs/utils/scaffold-eth/decodeTxData.ts | 16 +- .../scaffold-eth/fetchPriceFromUniswap.ts | 7 +- .../nextjs/utils/scaffold-eth/getMetadata.ts | 24 +- .../utils/scaffold-eth/getParsedError.ts | 2 +- .../nextjs/utils/scaffold-eth/networks.ts | 32 +- packages/nextjs/vercel.json | 3 + yarn.lock | 3218 +++++++++++------ 136 files changed, 5356 insertions(+), 9259 deletions(-) create mode 100644 .vercelignore create mode 100644 packages/foundry/._.prettier.json create mode 100644 packages/foundry/.prettier.json delete mode 100644 packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708664995.json delete mode 100644 packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708665001.json delete mode 100644 packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-latest.json delete mode 100644 packages/foundry/deployments/11155111.json delete mode 100644 packages/foundry/lib/forge-std/.gitmodules delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/.github/workflows/build.yml delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/.gitignore delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/LICENSE delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/Makefile delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/default.nix delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/demo/demo.sol delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/package.json delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/src/test.sol delete mode 100644 packages/foundry/lib/forge-std/lib/ds-test/src/test.t.sol create mode 100644 packages/foundry/lib/forge-std/src/StdToml.sol create mode 100644 packages/foundry/lib/forge-std/test/StdJson.t.sol create mode 100644 packages/foundry/lib/forge-std/test/StdToml.t.sol create mode 100644 packages/foundry/lib/forge-std/test/fixtures/test.json create mode 100644 packages/foundry/lib/forge-std/test/fixtures/test.toml create mode 100644 packages/foundry/lib/openzeppelin-contracts/contracts/mocks/Base64Dirty.sol create mode 100644 packages/nextjs/app/blockexplorer/transaction/_components/TransactionComp.tsx delete mode 100644 packages/nextjs/hooks/scaffold-eth/useAccountBalance.ts delete mode 100644 packages/nextjs/hooks/scaffold-eth/useAutoConnect.ts delete mode 100644 packages/nextjs/hooks/scaffold-eth/useScaffoldContractWrite.ts rename packages/nextjs/hooks/scaffold-eth/{useScaffoldContractRead.ts => useScaffoldReadContract.ts} (52%) rename packages/nextjs/hooks/scaffold-eth/{useScaffoldEventSubscriber.ts => useScaffoldWatchContractEvent.ts} (74%) create mode 100644 packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts create mode 100644 packages/nextjs/hooks/scaffold-eth/useWatchBalance.ts delete mode 100644 packages/nextjs/public/logo-transparent.png delete mode 100644 packages/nextjs/public/logo.png delete mode 100644 packages/nextjs/services/web3/wagmi-burner/BurnerConnector.ts delete mode 100644 packages/nextjs/services/web3/wagmi-burner/BurnerConnectorErrors.ts delete mode 100644 packages/nextjs/services/web3/wagmi-burner/BurnerConnectorTypes.ts delete mode 100644 packages/nextjs/services/web3/wagmi-burner/burnerWalletConfig.ts create mode 100644 packages/nextjs/vercel.json diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 31e3a20..9938cae 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,7 +17,6 @@ jobs: os: [ubuntu-latest] node: [lts/*] - steps: - name: Checkout uses: actions/checkout@master @@ -26,26 +25,19 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - cache : yarn + cache: yarn - name: Install dependencies run: yarn install --immutable - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: Run foundry node, deploy contracts (& generate contracts typescript output) - env: - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + - name: Run hardhat node, deploy contracts (& generate contracts typescript output) run: yarn chain & yarn deploy - id: build - - - name: Run tests - run: yarn test -vvv - name: Run nextjs lint run: yarn next:lint --max-warnings=0 - name: Check typings on nextjs run: yarn next:check-types - \ No newline at end of file + + - name: Run hardhat lint + run: yarn hardhat:lint --max-warnings=0 diff --git a/.gitignore b/.gitignore index 85bdcba..3c5d60d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,23 @@ +# dependencies node_modules -# dependencies, yarn, etc -# yarn / eslint +# yarn .yarn/* !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions + +# eslint .eslintcache -.vscode/** -.DS_Store \ No newline at end of file + +# misc +.DS_Store + +# IDE +.vscode +.idea + +# cli +dist \ No newline at end of file diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 0000000..cccc7d1 --- /dev/null +++ b/.vercelignore @@ -0,0 +1,65 @@ +# --- Monorepo files --- + +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions +.eslintcache +.DS_Store +.vscode +.idea +.vercel + +# --- Next.js files --- + +# dependencies +packages/nextjs/node_modules +packages/nextjs/.pnp +packages/nextjs/.pnp.js + +# testing +packages/nextjs/coverage + +# next.js +packages/nextjs/.next/ +packages/nextjs/out/ + +# production +packages/nextjs/build + +# misc +packages/nextjs/.DS_Store +packages/nextjs/*.pem + +# debug +packages/nextjs/npm-debug.log* +packages/nextjs/yarn-debug.log* +packages/nextjs/yarn-error.log* +packages/nextjs/.pnpm-debug.log* + +# local env files +packages/nextjs/.env.local +packages/nextjs/.env.development.local +packages/nextjs/.env.test.local +packages/nextjs/.env.production.local + +# typescript +packages/nextjs/*.tsbuildinfo + +# --- Foundry files --- + +# Compiler files +packages/foundry/cache +packages/foundry/out + +# Ignores development broadcast logs +packages/foundry/broadcast + +# Docs +packages/foundry/docs + +# Dotenv file +packages/foundry/.env +packages/foundry/localhost.json \ No newline at end of file diff --git a/README.md b/README.md index 6556606..a0897a1 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,6 @@ On the home page, you should see many colorful and variable cards and widgets wh By navigating to the `Debug Contracts` page, you can interact with and view the properties of your deployed Reputation System! - \ No newline at end of file +Valid `CreateToken` parameters in debug window: `{ "maxMintAmountPerTx": "0x16", "isTradeable": true }` --> diff --git a/package.json b/package.json index a1dd25f..7432237 100644 --- a/package.json +++ b/package.json @@ -13,19 +13,22 @@ "compile": "yarn workspace @se-2/foundry compile", "deploy": "yarn workspace @se-2/foundry deploy", "deploy:verify": "yarn workspace @se-2/foundry deploy:verify", + "flatten": "yarn workspace @se-2/foundry flatten", "fork": "yarn workspace @se-2/foundry fork", + "format": "yarn next:format && yarn foundry:format", + "foundry:format": "yarn workspace @se-2/foundry format", "foundry:lint": "yarn workspace @se-2/foundry lint", "foundry:test": "yarn workspace @se-2/foundry test", - "foundry:snapshot": "yarn workspace @se-2/foundry snapshot", "generate": "yarn workspace @se-2/foundry generate", "postinstall": "husky install", + "next:build": "yarn workspace @se-2/nextjs build", "next:check-types": "yarn workspace @se-2/nextjs check-types", "next:format": "yarn workspace @se-2/nextjs format", "next:lint": "yarn workspace @se-2/nextjs lint", + "next:serve": "yarn workspace @se-2/nextjs serve", "precommit": "lint-staged", "prepare": "install-self-peers -- --ignore-scripts", "start": "yarn workspace @se-2/nextjs dev", - "snapshot": "yarn foundry:snapshot", "test": "yarn foundry:test", "vercel": "yarn workspace @se-2/nextjs vercel", "vercel:yolo": "yarn workspace @se-2/nextjs vercel:yolo", @@ -36,7 +39,12 @@ }, "devDependencies": { "husky": "~8.0.3", - "lint-staged": "~13.2.2" + "lint-staged": "~13.2.2", + "next": "~14.0.4", + "vercel": "~32.4.1" }, - "packageManager": "yarn@3.2.3" + "packageManager": "yarn@3.2.3", + "engines": { + "node": ">=18.17.0" + } } diff --git a/packages/foundry/._.prettier.json b/packages/foundry/._.prettier.json new file mode 100644 index 0000000000000000000000000000000000000000..0ecd41e77b368650c4292bda5c38a7e294971311 GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103v`v2yb z5JU&V0-$mMG%bukK2%&PIX_n~v7jI)RWB#8xTLf=H6ukeOGKnpcvUpO=`EQ>l=XnpUEal#`g34eSd;bq#3>)&Fp>$S}zL G{|^ARNh@{$ literal 0 HcmV?d00001 diff --git a/packages/foundry/.prettier.json b/packages/foundry/.prettier.json new file mode 100644 index 0000000..7eef1ab --- /dev/null +++ b/packages/foundry/.prettier.json @@ -0,0 +1,6 @@ +{ + "arrowParens": "avoid", + "printWidth": 120, + "tabWidth": 2, + "trailingComma": "all" +} diff --git a/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708664995.json b/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708664995.json deleted file mode 100644 index 36476a1..0000000 --- a/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708664995.json +++ /dev/null @@ -1,401 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionType": "CREATE", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": null, - "arguments": [ - "0x62286D694F89a1B12c0214bfcD567bb6c2951491", - "[0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1, 0x62286D694F89a1B12c0214bfcD567bb6c2951491]" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "gas": "0x42e513", - "value": "0x0", - "data": "0x60806040523480156200001157600080fd5b5060405162003c5238038062003c528339810160408190526200003491620001f7565b62000040828262000048565b5050620002f6565b62000053826200009f565b60005b81518110156200009a57620000916000801b8383815181106200007d576200007d620002e0565b6020026020010151620000ad60201b60201c565b60010162000056565b505050565b620000aa8162000123565b50565b60008281527fd3889cc5458b268d0544e5534672df1296288ca3f93cbd39bd6f497a5c62281160205260409020620000e6908262000160565b5060405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b03831617905550565b600062000177836001600160a01b03841662000180565b90505b92915050565b60008181526001830160205260408120546200017a575081546001808201845560008481526020808220909301849055845493815293810190915260409092205590565b80516001600160a01b0381168114620001dc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200020b57600080fd5b6200021683620001c4565b602084810151919350906001600160401b03808211156200023657600080fd5b818601915086601f8301126200024b57600080fd5b815181811115620002605762000260620001e1565b8060051b604051601f19603f83011681018181108582111715620002885762000288620001e1565b604052918252848201925083810185019189831115620002a757600080fd5b938501935b82851015620002d057620002c085620001c4565b84529385019392850192620002ac565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b61394c80620003066000396000f3fe608060405234801561001057600080fd5b506004361061027e5760003560e01c806379ba50971161015c578063b9ebd670116100ce578063d547741f11610087578063d547741f146106cb578063e951c5ab146106de578063e985e9c5146106f3578063f0bd87cc14610706578063f242432a1461071b578063f2fde38b1461072e57600080fd5b8063b9ebd67014610631578063bd85b03914610644578063c660531314610657578063ca15c8731461066a578063caa2fe321461067d578063d5391393146106a457600080fd5b80638da5cb5b116101205780638da5cb5b146105ca5780639010d07c146105d257806391d14854146105e557806398d3b6d3146105f8578063a22cb4651461060b578063aa05af231461061e57600080fd5b806379ba50971461056d57806385bff2e7146105755780638ab5150a146105885780638ada943b146105905780638bb9c5bf146105b757600080fd5b80632f2ff15d116101f55780634edea111116101b95780634edea111146104755780635a449111146104ed5780635c18ca8b146105005780635e882316146105135780636dcfd8411461053a57806377fe53f61461055a57600080fd5b80632f2ff15d1461039a5780633b2a8587146103ad578063412fc1fa146103fe5780634797c5871461042e5780634e1273f41461045557600080fd5b806313fa095f1161024757806313fa095f1461031457806314aefd3814610327578063162094c41461033a578063248a9ca31461034d578063282c51f3146103605780632eb2c2d61461038757600080fd5b8062fdd58e1461028357806301ffc9a7146102a957806303fe26f7146102cc5780630e89341c146102e157806313ba55df14610301575b600080fd5b6102966102913660046129a9565b610741565b6040519081526020015b60405180910390f35b6102bc6102b73660046129e9565b610756565b60405190151581526020016102a0565b6102df6102da366004612c08565b610797565b005b6102f46102ef366004612c3c565b6107b3565b6040516102a09190612ca5565b61029661030f366004612c3c565b610982565b6102df610322366004612cb8565b61098d565b6102df610335366004612d20565b610997565b6102df610348366004612d99565b6109ce565b61029661035b366004612c3c565b610a07565b6102967f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6102df610395366004612e7e565b610a12565b6102df6103a8366004612f27565b610a64565b6103e66103bb366004612cb8565b6001600160a01b03908116600090815260008051602061387783398151915260205260409020541690565b6040516001600160a01b0390911681526020016102a0565b61029661040c366004612c3c565b6000908152600080516020613897833981519152602052604090206001015490565b6102967f60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776381565b610468610463366004612f53565b610a80565b6040516102a0919061304f565b6104d0610483366004612c3c565b604080518082018252600080825260209182018190529283526000805160206138978339815191528152918190208151808301909252805460ff1615158252600101549181019190915290565b6040805182511515815260209283015192810192909252016102a0565b6102df6104fb366004613062565b610bea565b6102df61050e366004613116565b610c66565b6102967f9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310481565b61054d610548366004612c3c565b610c9c565b6040516102a0919061314a565b6102df610568366004613197565b610ca7565b6102df610cf7565b610468610583366004612cb8565b610d3a565b6103e6610d45565b6102967f832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b81565b6102df6105c5366004612c3c565b610d54565b6103e6610d5d565b6103e66105e03660046131f0565b610d67565b6102bc6105f3366004612f27565b610d73565b6102df610606366004613212565b610d7f565b6102df61061936600461323c565b610db3565b6102df61062c366004613266565b610e67565b6102df61063f3660046132d9565b610e90565b610296610652366004612c3c565b610ef3565b6102df6106653660046132fd565b610f26565b610296610678366004612c3c565b610f49565b6102967ffc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a81565b6102967f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102df6106d9366004612f27565b610f54565b6000805160206138b783398151915254610296565b6102bc610701366004613212565b610f70565b61029660008051602061385783398151915281565b6102df610729366004613343565b610fbd565b6102df61073c366004612cb8565b61112e565b600061074d8383611170565b90505b92915050565b6001600160e01b0319811660009081527ffc606c433378e3a7e0a6a531deac289b66caa1b4aa8554fd4ab2c6f1570f92d8602052604081205460ff16610750565b6107b081604051806020016040528060008152506111ce565b50565b60008181527f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f56020526040812080546060927f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f4929091610812906133a7565b80601f016020809104026020016040519081016040528092919081815260200182805461083e906133a7565b801561088b5780601f106108605761010080835404028352916020019161088b565b820191906000526020600020905b81548152906001019060200180831161086e57829003601f168201915b5050505050905060008260000180546108a3906133a7565b80601f01602080910402602001604051908101604052809291908181526020018280546108cf906133a7565b801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b50505050509050805160000361093457509392505050565b81511561096757808260405160200161094e9291906133e1565b6040516020818303038152906040529350505050919050565b8061097186611205565b60405160200161094e9291906133e1565b60006107508261130d565b6107b03382611343565b7f60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d177636109c1816113a7565b6109ca826113b1565b5050565b7f9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece35831046109f8816113a7565b610a02838361142e565b505050565b6000610750826114a2565b6001600160a01b0385163314801590610a325750610a308533610f70565b155b15610a4f576040516212efed60e91b815260040160405180910390fd5b610a5d3386868686866114c4565b5050505050565b610a6d826114a2565b610a76816113a7565b610a0283836114e8565b60608151835114610aa457604051633e7e0b6d60e11b815260040160405180910390fd5b82516000805160206138d7833981519152906000906001600160401b03811115610ad057610ad0612a06565b604051908082528060200260200182016040528015610af9578160200160208202803683370190505b50905060005b8551811015610be15760006001600160a01b0316868281518110610b2557610b25613410565b60200260200101516001600160a01b031603610b545760405163db5d879760e01b815260040160405180910390fd5b826000868381518110610b6957610b69613410565b602002602001015181526020019081526020016000206000878381518110610b9357610b93613410565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054828281518110610bce57610bce613410565b6020908102919091010152600101610aff565b50949350505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610c14816113a7565b610c30600080516020613857833981519152836000015161154a565b610c4d5760405163c84a864d60e01b815260040160405180910390fd5b6109ca826040518060200160405280600081525061156f565b60005b81518110156109ca57610c94828281518110610c8757610c87613410565b6020026020010151610997565b600101610c69565b6060610750826116c0565b60005b8151811015610a0257610cef838281518110610cc857610cc8613410565b6020026020010151838381518110610ce257610ce2613410565b6020026020010151610e90565b600101610caa565b610cff611793565b6001600160a01b0316336001600160a01b031614610d305760405163efd1052d60e01b815260040160405180910390fd5b610d386117c6565b565b606061075082611800565b6000610d4f611793565b905090565b6107b0816118c8565b6000610d4f6118d2565b600061074d83836118fa565b600061074d838361154a565b7f832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b610da9816113a7565b610a02838361191f565b6001600160a01b0382163303610ddc57604051637b30a93360e11b815260040160405180910390fd5b3360008181527f1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080516020613857833981519152610e7f816113a7565b610e8a848484611a2d565b50505050565b7ffc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a610eba816113a7565b6000805160206138b7833981519152548310610ee9576040516301ca465760e71b815260040160405180910390fd5b610a028383611a65565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ea6020526040812054610750565b600080516020613857833981519152610f3e816113a7565b610e8a848484611ae6565b600061075082611c60565b610f5d826114a2565b610f66816113a7565b610a028383611c84565b6001600160a01b0391821660009081527f1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68c6020908152604080832093909416825291909152205460ff1690565b6000805160206138f783398151915254600203610fed57604051635db5c7cd60e11b815260040160405180910390fd5b61100460026000805160206138f783398151915255565b61101c6000805160206138578339815191528661154a565b1561103a5760405163a4e583af60e01b815260040160405180910390fd5b6110647f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8488561154a565b611081576040516372adea5560e11b815260040160405180910390fd5b6000838152600080516020613897833981519152602052604090205460ff166110bd57604051638b69d31f60e01b815260040160405180910390fd5b6110ca8585858585611ce6565b836001600160a01b0316856001600160a01b03167f805bf530142475cfb4c3eaecae0d042e3d819b3e2915ba5036e2819fe92ab27f8460405161110f91815260200190565b60405180910390a3610a5d60016000805160206138f783398151915255565b6111366118d2565b6001600160a01b0316336001600160a01b03161461116757604051632f7a8ee160e01b815260040160405180910390fd5b6107b081611d31565b60006001600160a01b0383166111995760405163db5d879760e01b815260040160405180910390fd5b6000805160206138d78339815191526000928352602090815260408084206001600160a01b0395909516845293905250205490565b60005b8251811015610a02576111fd8382815181106111ef576111ef613410565b60200260200101518361156f565b6001016111d1565b60608160000361122c5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561125657806112408161343c565b915061124f9050600a8361346b565b9150611230565b6000816001600160401b0381111561127057611270612a06565b6040519080825280601f01601f19166020018201604052801561129a576020820181803683370190505b5090505b8415611305576112af60018361347f565b91506112bc600a86613492565b6112c79060306134a6565b60f81b8183815181106112dc576112dc613410565b60200101906001600160f81b031916908160001a9053506112fe600a8661346b565b945061129e565b949350505050565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb6020526040812061075090611d72565b6001600160a01b038281166000818152600080516020613877833981519152602052604080822080546001600160a01b0319169486169485179055517f57e330d54e3668c90601656969884d7b4e3eefb3d3fb674b313c405b1bd33bc89190a35050565b6107b08133611d7c565b6113ca6000805160206138b78339815191525482611a65565b6000805160206138b783398151915280549060006113e78361343c565b909155505060408051825115158152602080840151908201527f87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9910160405180910390a150565b60008281527f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f5602052604090206114658282613501565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b826040516114969190612ca5565b60405180910390a25050565b6000908152600080516020613837833981519152602052604090206002015490565b6114d2868686868686611de7565b6114e0868686868686611f90565b505050505050565b60008281526000805160206138378339815191526020526040902061150d90826120a9565b5060405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526000805160206138378339815191526020526040812061074d90836120be565b815161157a906120e0565b60005b826020015151811015610a02576000805160206138b78339815191526001016000846020015183815181106115b4576115b4613410565b602002602001015160000151815260200190815260200160002060010154836020015182815181106115e8576115e8613410565b602002602001015160200151111561161357604051631eef750160e21b815260040160405180910390fd5b61166583600001518460200151838151811061163157611631613410565b6020026020010151600001518560200151848151811061165357611653613410565b60200260200101516020015185612116565b826020015160405161167791906135c0565b604051908190038120845190916001600160a01b039091169033907f42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e390600090a460010161157d565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb602052604081206060916116f982611d72565b6001600160401b0381111561171057611710612a06565b604051908082528060200260200182016040528015611739578160200160208202803683370190505b50905060005b61174883611d72565b81101561178b5761175983826121ef565b82828151811061176b5761176b613410565b6001600160a01b039092166020928302919091019091015260010161173f565b509392505050565b60007f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce66178905b546001600160a01b0316919050565b6117cf336121fb565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319169055565b6001600160a01b03811660009081527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ec6020526040812060609161184382611d72565b6001600160401b0381111561185a5761185a612a06565b604051908082528060200260200182016040528015611883578160200160208202803683370190505b50905060005b61189283611d72565b81101561178b576118a383826121ef565b8282815181106118b5576118b5613410565b6020908102919091010152600101611889565b6107b08133611c84565b60007f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f6716804606117b7565b60008281526000805160206138378339815191526020526040812061074d90836121ef565b6000805160206138f78339815191525460020361194f57604051635db5c7cd60e11b815260040160405180910390fd5b61196660026000805160206138f783398151915255565b6000611973836000610741565b90506000611982846001610741565b90506119a1848460008560405180602001604052806000815250611ce6565b6119be848460018460405180602001604052806000815250611ce6565b826001600160a01b0316846001600160a01b03167f5a418b0cf08f643a71a8bbd6807f2b525efadd21706c1e14d09f557d9ca3e19f8484604051611a0c929190918252602082015260400190565b60405180910390a350506109ca60016000805160206138f783398151915255565b60005b8251811015610e8a57611a5d84848381518110611a4f57611a4f613410565b602002602001015184611ae6565b600101611a30565b8051600083815260008051602061389783398151915260209081526040808320805460ff1916941515949094178455818501805160019095019490945580518551151581529351918401919091528051928390030182209184917f27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba91a35050565b6000805160206138f783398151915254600203611b1657604051635db5c7cd60e11b815260040160405180910390fd5b611b2d60026000805160206138f783398151915255565b8151611b38906120e0565b60005b826020015151811015611bce57611bc68460008051602061387783398151915285516001600160a01b03908116600090815260209283526040902054918701518051929091169185908110611b9257611b92613410565b60200260200101516000015186602001518581518110611bb457611bb4613410565b60200260200101516020015186611ce6565b600101611b3b565b508160200151604051611be191906135c0565b6040518091039020611bfe60008051602061387783398151915290565b83516001600160a01b039081166000908152602092909252604080832054905190821692918716917f96e1e27b000adc867e6fda1757d8650ff9f7377e0271df95c7f72c4f74f1251b91a4610a0260016000805160206138f783398151915255565b60008181526000805160206138378339815191526020526040812061075090611d72565b600082815260008051602061383783398151915260205260409020611ca99082612275565b5060405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b6001600160a01b0385163314801590611d065750611d048533610f70565b155b15611d23576040516212efed60e91b815260040160405180910390fd5b610a5d33868686868661228a565b6107b0817f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b03831617905550565b6000610750825490565b611d86828261154a565b6109ca57611d9c816001600160a01b03166122a6565b611da78360206122b8565b604051602001611db8929190613601565b60408051601f198184030181529082905262461bcd60e51b8252611dde91600401612ca5565b60405180910390fd5b6001600160a01b038416611e0e5760405163f5cadad560e01b815260040160405180910390fd5b8151835114611e3057604051633e7e0b6d60e11b815260040160405180910390fd5b611e3e86868686868661240a565b6000805160206138d783398151915260005b8451811015611f2f576000858281518110611e6d57611e6d613410565b602002602001015190506000858381518110611e8b57611e8b613410565b602090810291909101810151600084815286835260408082206001600160a01b038e168352909352919091205490915080821115611edc5760405163119ac6bb60e31b815260040160405180910390fd5b6000838152602086815260408083206001600160a01b038e811685529252808320938590039093558a168152908120805460019590950194839290611f229084906134a6565b90915550611e5092505050565b50846001600160a01b0316866001600160a01b0316886001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611f7f929190613676565b60405180910390a450505050505050565b6001600160a01b0384163b156114e05760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611fd490899089908890889088906004016136a4565b6020604051808303816000875af192505050801561200f575060408051601f3d908101601f1916820190925261200c91810190613702565b60015b61206f5761201b61371f565b806308c379a003612054575061202f61373b565b8061203a5750612056565b8060405162461bcd60e51b8152600401611dde9190612ca5565b505b60405163380147a960e01b815260040160405180910390fd5b6001600160e01b0319811663bc197c8160e01b146120a057604051633744db2960e01b815260040160405180910390fd5b50505050505050565b600061074d836001600160a01b038416612418565b6001600160a01b0381166000908152600183016020526040812054151561074d565b6001600160a01b0381811660009081526000805160206138778339815191526020526040902054166107b0576107b08182611343565b6001600160a01b03841661213d576040516301c8efbf60e11b815260040160405180910390fd5b61215c3360008661214d8761245b565b6121568761245b565b8661240a565b60008381526000805160206138d7833981519152602090815260408083206001600160a01b03881684529091528120805484929061219b9084906134a6565b909155505060408051848152602081018490526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b600061074d83836124a6565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546040516001600160a01b038481169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a380546001600160a01b0319166001600160a01b0392909216919091179055565b600061074d836001600160a01b0384166124f2565b6122988686868686866125b7565b6114e08686868686866126cd565b60606107506001600160a01b03831660145b606060006122c78360026137c4565b6122d29060026134a6565b6001600160401b038111156122e9576122e9612a06565b6040519080825280601f01601f191660200182016040528015612313576020820181803683370190505b509050600360fc1b8160008151811061232e5761232e613410565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061235d5761235d613410565b60200101906001600160f81b031916908160001a905350600160028402015b60018111156123ea576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106123ad576123ad613410565b1a60f81b8282815181106123c3576123c3613410565b60200101906001600160f81b031916908160001a90535060049490941c936000190161237c565b50831561074d5760405163c913478560e01b815260040160405180910390fd5b6114e0868686868686612789565b6000818152600183016020526040812054610750575081546001808201845560008481526020808220909301849055845493815293810190915260409092205590565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061249557612495613410565b602090810291909101015292915050565b815460009082106124ca5760405163e637bf3b60e01b815260040160405180910390fd5b8260000182815481106124df576124df613410565b9060005260206000200154905092915050565b600081815260018301602052604081205480156125b05783546000908590600019810190811061252457612524613410565b906000526020600020015490508085600001600184038154811061254a5761254a613410565b600091825260208083209091019290925591825260018601905260409020819055835484908061257c5761257c6137db565b6001900381819060005260206000200160009055905583600101600084815260200190815260200160002060009055600191505b5092915050565b6001600160a01b0384166125de5760405163f5cadad560e01b815260040160405180910390fd5b6125ed86868661214d8761245b565b60008381526000805160206138d7833981519152602081815260408084206001600160a01b038a168552909152909120548084111561263f5760405163119ac6bb60e31b815260040160405180910390fd5b6000858152602083815260408083206001600160a01b038b8116855292528083209387900390935587168152908120805485929061267e9084906134a6565b909155505060408051858152602081018590526001600160a01b038088169289821692918b16917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629101611f7f565b6001600160a01b0384163b156114e05760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061271190899089908890889088906004016137f1565b6020604051808303816000875af192505050801561274c575060408051601f3d908101601f1916820190925261274991810190613702565b60015b6127585761201b61371f565b6001600160e01b0319811663f23a6e6160e01b146120a057604051633744db2960e01b815260040160405180910390fd5b836001600160a01b0316856001600160a01b0316146114e0576001600160a01b0385811660009081527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ec6020526040808220928716825281207fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ea927fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb929091905b875181101561296857600087828151811061284757612847613410565b60200260200101519050600081111561295f57600089838151811061286e5761286e613410565b6020026020010151905060006001600160a01b03168c6001600160a01b0316036128bb57600081815260208890526040812080548492906128b09084906134a6565b909155506128f09050565b816128c68d83611170565b036128f05760008181526020879052604090206128e3908d612275565b506128ee8582612975565b505b6001600160a01b038b16612927576000818152602088905260408120805484929061291c90849061347f565b9091555061295d9050565b6129318b82611170565b60000361295d576000818152602087905260409020612950908c6120a9565b5061295b8482612981565b505b505b5060010161282a565b5050505050505050505050565b600061074d83836124f2565b600061074d8383612418565b80356001600160a01b03811681146129a457600080fd5b919050565b600080604083850312156129bc57600080fd5b6129c58361298d565b946020939093013593505050565b6001600160e01b0319811681146107b057600080fd5b6000602082840312156129fb57600080fd5b813561074d816129d3565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715612a3b57612a3b612a06565b60405250565b601f8201601f191681016001600160401b0381118282101715612a6657612a66612a06565b6040525050565b60006001600160401b03821115612a8657612a86612a06565b5060051b60200190565b60006040808385031215612aa357600080fd5b8051612aae81612a1c565b809250612aba8461298d565b81526020808501356001600160401b03811115612ad657600080fd5b8501601f81018713612ae757600080fd5b8035612af281612a6d565b8551612afe8282612a41565b82815260069290921b8301840191848101915089831115612b1e57600080fd5b928401925b82841015612b615786848b031215612b3b5760008081fd5b8651612b4681612a1c565b84358152858501358682015282529286019290840190612b23565b80858701525050505050505092915050565b600082601f830112612b8457600080fd5b81356020612b9182612a6d565b604051612b9e8282612a41565b83815260059390931b8501820192828101915086841115612bbe57600080fd5b8286015b84811015612bfd5780356001600160401b03811115612be15760008081fd5b612bef8986838b0101612a90565b845250918301918301612bc2565b509695505050505050565b600060208284031215612c1a57600080fd5b81356001600160401b03811115612c3057600080fd5b61130584828501612b73565b600060208284031215612c4e57600080fd5b5035919050565b60005b83811015612c70578181015183820152602001612c58565b50506000910152565b60008151808452612c91816020860160208601612c55565b601f01601f19169290920160200192915050565b60208152600061074d6020830184612c79565b600060208284031215612cca57600080fd5b61074d8261298d565b803580151581146129a457600080fd5b600060408284031215612cf557600080fd5b604051612d0181612a1c565b809150612d0d83612cd3565b8152602083013560208201525092915050565b600060408284031215612d3257600080fd5b61074d8383612ce3565b60006001600160401b03831115612d5557612d55612a06565b604051612d6c601f8501601f191660200182612a41565b809150838152848484011115612d8157600080fd5b83836020830137600060208583010152509392505050565b60008060408385031215612dac57600080fd5b8235915060208301356001600160401b03811115612dc957600080fd5b8301601f81018513612dda57600080fd5b612de985823560208401612d3c565b9150509250929050565b600082601f830112612e0457600080fd5b81356020612e1182612a6d565b604051612e1e8282612a41565b80915083815260208101915060208460051b870101935086841115612e4257600080fd5b602086015b84811015612bfd5780358352918301918301612e47565b600082601f830112612e6f57600080fd5b61074d83833560208501612d3c565b600080600080600060a08688031215612e9657600080fd5b612e9f8661298d565b9450612ead6020870161298d565b935060408601356001600160401b0380821115612ec957600080fd5b612ed589838a01612df3565b94506060880135915080821115612eeb57600080fd5b612ef789838a01612df3565b93506080880135915080821115612f0d57600080fd5b50612f1a88828901612e5e565b9150509295509295909350565b60008060408385031215612f3a57600080fd5b82359150612f4a6020840161298d565b90509250929050565b60008060408385031215612f6657600080fd5b82356001600160401b0380821115612f7d57600080fd5b818501915085601f830112612f9157600080fd5b81356020612f9e82612a6d565b604051612fab8282612a41565b83815260059390931b8501820192828101915089841115612fcb57600080fd5b948201945b83861015612ff057612fe18661298d565b82529482019490820190612fd0565b9650508601359250508082111561300657600080fd5b50612de985828601612df3565b60008151808452602080850194506020840160005b8381101561304457815187529582019590820190600101613028565b509495945050505050565b60208152600061074d6020830184613013565b60006020828403121561307457600080fd5b81356001600160401b0381111561308a57600080fd5b61130584828501612a90565b600082601f8301126130a757600080fd5b813560206130b482612a6d565b604080516130c28382612a41565b80925084815260208101925060208560061b8801019450878511156130e657600080fd5b602087015b8581101561310a576130fd8982612ce3565b84529284019282016130eb565b50979650505050505050565b60006020828403121561312857600080fd5b81356001600160401b0381111561313e57600080fd5b61130584828501613096565b6020808252825182820181905260009190848201906040850190845b8181101561318b5783516001600160a01b031683529284019291840191600101613166565b50909695505050505050565b600080604083850312156131aa57600080fd5b82356001600160401b03808211156131c157600080fd5b6131cd86838701612df3565b935060208501359150808211156131e357600080fd5b50612de985828601613096565b6000806040838503121561320357600080fd5b50508035926020909101359150565b6000806040838503121561322557600080fd5b61322e8361298d565b9150612f4a6020840161298d565b6000806040838503121561324f57600080fd5b6132588361298d565b9150612f4a60208401612cd3565b60008060006060848603121561327b57600080fd5b6132848461298d565b925060208401356001600160401b03808211156132a057600080fd5b6132ac87838801612b73565b935060408601359150808211156132c257600080fd5b506132cf86828701612e5e565b9150509250925092565b600080606083850312156132ec57600080fd5b82359150612f4a8460208501612ce3565b60008060006060848603121561331257600080fd5b61331b8461298d565b925060208401356001600160401b038082111561333757600080fd5b6132ac87838801612a90565b600080600080600060a0868803121561335b57600080fd5b6133648661298d565b94506133726020870161298d565b9350604086013592506060860135915060808601356001600160401b0381111561339b57600080fd5b612f1a88828901612e5e565b600181811c908216806133bb57607f821691505b6020821081036133db57634e487b7160e01b600052602260045260246000fd5b50919050565b600083516133f3818460208801612c55565b835190830190613407818360208801612c55565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161344e5761344e613426565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261347a5761347a613455565b500490565b8181038181111561075057610750613426565b6000826134a1576134a1613455565b500690565b8082018082111561075057610750613426565b601f821115610a02576000816000526020600020601f850160051c810160208610156134e25750805b601f850160051c820191505b818110156114e0578281556001016134ee565b81516001600160401b0381111561351a5761351a612a06565b61352e8161352884546133a7565b846134b9565b602080601f831160018114613563576000841561354b5750858301515b600019600386901b1c1916600185901b1785556114e0565b600085815260208120601f198616915b8281101561359257888601518255948401946001909101908401613573565b50858210156135b05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b815160009082906020808601845b838110156135f55781518051865283015183860152604090940193908201906001016135ce565b50929695505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613639816017850160208801612c55565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161366a816028840160208801612c55565b01602801949350505050565b6040815260006136896040830185613013565b828103602084015261369b8185613013565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906136d090830186613013565b82810360608401526136e28186613013565b905082810360808401526136f68185612c79565b98975050505050505050565b60006020828403121561371457600080fd5b815161074d816129d3565b600060033d11156137385760046000803e5060005160e01c5b90565b600060443d10156137495790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561377857505050505090565b82850191508151818111156137905750505050505090565b843d87010160208285010111156137aa5750505050505090565b6137b960208286010187612a41565b509095945050505050565b808202811582820484141761075057610750613426565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061382b90830184612c79565b97965050505050505056fed3889cc5458b268d0544e5534672df1296288ca3f93cbd39bd6f497a5c622811fbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c74392e177520418e6f87f79a16f906a1486466a2682623913688b2e8a8ea3aad156e11ec25828e1d37e7012fb60d670d0c2e6c7b9b5a25209c94dffa2313dc4f156e11ec25828e1d37e7012fb60d670d0c2e6c7b9b5a25209c94dffa2313dc4e1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68b09acf4e54214992e70883cf7dcd6957ff2c71cd9e14df4bec4383bc0d11607dca264697066735822122026f5cef95ce4370f3537e3d8fa34b140aa96dafa99926b7695db7b6209d5b8ba64736f6c6343000816003300000000000000000000000062286d694f89a1b12c0214bfcd567bb6c29514910000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de100000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x0" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776300000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x1" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15dfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x2" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310400000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x3" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a600000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x4" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15dfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x5" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x6" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776300000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15dfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x8" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310400000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x9" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a600000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xa" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15dfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xb" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xc" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "batchCreateTokens((bool,uint256)[])", - "arguments": [ - "[(false, 100), (true, 100)]" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x29f49", - "value": "0x0", - "data": "0x5c18ca8b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064", - "nonce": "0xd" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "setTokenURI(uint256,string)", - "arguments": [ - "0", - "\"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/0\"" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x27cb0", - "value": "0x0", - "data": "0x162094c4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3000000000000000000000000000000000000000000000000000000000", - "nonce": "0xe" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "setTokenURI(uint256,string)", - "arguments": [ - "1", - "\"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/1\"" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x27cc1", - "value": "0x0", - "data": "0x162094c4000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3100000000000000000000000000000000000000000000000000000000", - "nonce": "0xf" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "mint((address,(uint256,uint256)[]))", - "arguments": [ - "(0x62286D694F89a1B12c0214bfcD567bb6c2951491, [(0, 50), (1, 50)])" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x89bfe", - "value": "0x0", - "data": "0x5a449111000000000000000000000000000000000000000000000000000000000000002000000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032", - "nonce": "0x10" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [], - "libraries": [], - "pending": [ - "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16" - ], - "returns": {}, - "timestamp": 1708664995, - "chain": 11155111, - "multi": false, - "commit": "7423c19" -} \ No newline at end of file diff --git a/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708665001.json b/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708665001.json deleted file mode 100644 index 3fad0a2..0000000 --- a/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-1708665001.json +++ /dev/null @@ -1,1060 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionType": "CREATE", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": null, - "arguments": [ - "0x62286D694F89a1B12c0214bfcD567bb6c2951491", - "[0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1, 0x62286D694F89a1B12c0214bfcD567bb6c2951491]" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "gas": "0x42e513", - "value": "0x0", - "data": "0x60806040523480156200001157600080fd5b5060405162003c5238038062003c528339810160408190526200003491620001f7565b62000040828262000048565b5050620002f6565b62000053826200009f565b60005b81518110156200009a57620000916000801b8383815181106200007d576200007d620002e0565b6020026020010151620000ad60201b60201c565b60010162000056565b505050565b620000aa8162000123565b50565b60008281527fd3889cc5458b268d0544e5534672df1296288ca3f93cbd39bd6f497a5c62281160205260409020620000e6908262000160565b5060405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b03831617905550565b600062000177836001600160a01b03841662000180565b90505b92915050565b60008181526001830160205260408120546200017a575081546001808201845560008481526020808220909301849055845493815293810190915260409092205590565b80516001600160a01b0381168114620001dc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200020b57600080fd5b6200021683620001c4565b602084810151919350906001600160401b03808211156200023657600080fd5b818601915086601f8301126200024b57600080fd5b815181811115620002605762000260620001e1565b8060051b604051601f19603f83011681018181108582111715620002885762000288620001e1565b604052918252848201925083810185019189831115620002a757600080fd5b938501935b82851015620002d057620002c085620001c4565b84529385019392850192620002ac565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b61394c80620003066000396000f3fe608060405234801561001057600080fd5b506004361061027e5760003560e01c806379ba50971161015c578063b9ebd670116100ce578063d547741f11610087578063d547741f146106cb578063e951c5ab146106de578063e985e9c5146106f3578063f0bd87cc14610706578063f242432a1461071b578063f2fde38b1461072e57600080fd5b8063b9ebd67014610631578063bd85b03914610644578063c660531314610657578063ca15c8731461066a578063caa2fe321461067d578063d5391393146106a457600080fd5b80638da5cb5b116101205780638da5cb5b146105ca5780639010d07c146105d257806391d14854146105e557806398d3b6d3146105f8578063a22cb4651461060b578063aa05af231461061e57600080fd5b806379ba50971461056d57806385bff2e7146105755780638ab5150a146105885780638ada943b146105905780638bb9c5bf146105b757600080fd5b80632f2ff15d116101f55780634edea111116101b95780634edea111146104755780635a449111146104ed5780635c18ca8b146105005780635e882316146105135780636dcfd8411461053a57806377fe53f61461055a57600080fd5b80632f2ff15d1461039a5780633b2a8587146103ad578063412fc1fa146103fe5780634797c5871461042e5780634e1273f41461045557600080fd5b806313fa095f1161024757806313fa095f1461031457806314aefd3814610327578063162094c41461033a578063248a9ca31461034d578063282c51f3146103605780632eb2c2d61461038757600080fd5b8062fdd58e1461028357806301ffc9a7146102a957806303fe26f7146102cc5780630e89341c146102e157806313ba55df14610301575b600080fd5b6102966102913660046129a9565b610741565b6040519081526020015b60405180910390f35b6102bc6102b73660046129e9565b610756565b60405190151581526020016102a0565b6102df6102da366004612c08565b610797565b005b6102f46102ef366004612c3c565b6107b3565b6040516102a09190612ca5565b61029661030f366004612c3c565b610982565b6102df610322366004612cb8565b61098d565b6102df610335366004612d20565b610997565b6102df610348366004612d99565b6109ce565b61029661035b366004612c3c565b610a07565b6102967f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6102df610395366004612e7e565b610a12565b6102df6103a8366004612f27565b610a64565b6103e66103bb366004612cb8565b6001600160a01b03908116600090815260008051602061387783398151915260205260409020541690565b6040516001600160a01b0390911681526020016102a0565b61029661040c366004612c3c565b6000908152600080516020613897833981519152602052604090206001015490565b6102967f60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776381565b610468610463366004612f53565b610a80565b6040516102a0919061304f565b6104d0610483366004612c3c565b604080518082018252600080825260209182018190529283526000805160206138978339815191528152918190208151808301909252805460ff1615158252600101549181019190915290565b6040805182511515815260209283015192810192909252016102a0565b6102df6104fb366004613062565b610bea565b6102df61050e366004613116565b610c66565b6102967f9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310481565b61054d610548366004612c3c565b610c9c565b6040516102a0919061314a565b6102df610568366004613197565b610ca7565b6102df610cf7565b610468610583366004612cb8565b610d3a565b6103e6610d45565b6102967f832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b81565b6102df6105c5366004612c3c565b610d54565b6103e6610d5d565b6103e66105e03660046131f0565b610d67565b6102bc6105f3366004612f27565b610d73565b6102df610606366004613212565b610d7f565b6102df61061936600461323c565b610db3565b6102df61062c366004613266565b610e67565b6102df61063f3660046132d9565b610e90565b610296610652366004612c3c565b610ef3565b6102df6106653660046132fd565b610f26565b610296610678366004612c3c565b610f49565b6102967ffc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a81565b6102967f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102df6106d9366004612f27565b610f54565b6000805160206138b783398151915254610296565b6102bc610701366004613212565b610f70565b61029660008051602061385783398151915281565b6102df610729366004613343565b610fbd565b6102df61073c366004612cb8565b61112e565b600061074d8383611170565b90505b92915050565b6001600160e01b0319811660009081527ffc606c433378e3a7e0a6a531deac289b66caa1b4aa8554fd4ab2c6f1570f92d8602052604081205460ff16610750565b6107b081604051806020016040528060008152506111ce565b50565b60008181527f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f56020526040812080546060927f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f4929091610812906133a7565b80601f016020809104026020016040519081016040528092919081815260200182805461083e906133a7565b801561088b5780601f106108605761010080835404028352916020019161088b565b820191906000526020600020905b81548152906001019060200180831161086e57829003601f168201915b5050505050905060008260000180546108a3906133a7565b80601f01602080910402602001604051908101604052809291908181526020018280546108cf906133a7565b801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b50505050509050805160000361093457509392505050565b81511561096757808260405160200161094e9291906133e1565b6040516020818303038152906040529350505050919050565b8061097186611205565b60405160200161094e9291906133e1565b60006107508261130d565b6107b03382611343565b7f60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d177636109c1816113a7565b6109ca826113b1565b5050565b7f9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece35831046109f8816113a7565b610a02838361142e565b505050565b6000610750826114a2565b6001600160a01b0385163314801590610a325750610a308533610f70565b155b15610a4f576040516212efed60e91b815260040160405180910390fd5b610a5d3386868686866114c4565b5050505050565b610a6d826114a2565b610a76816113a7565b610a0283836114e8565b60608151835114610aa457604051633e7e0b6d60e11b815260040160405180910390fd5b82516000805160206138d7833981519152906000906001600160401b03811115610ad057610ad0612a06565b604051908082528060200260200182016040528015610af9578160200160208202803683370190505b50905060005b8551811015610be15760006001600160a01b0316868281518110610b2557610b25613410565b60200260200101516001600160a01b031603610b545760405163db5d879760e01b815260040160405180910390fd5b826000868381518110610b6957610b69613410565b602002602001015181526020019081526020016000206000878381518110610b9357610b93613410565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054828281518110610bce57610bce613410565b6020908102919091010152600101610aff565b50949350505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610c14816113a7565b610c30600080516020613857833981519152836000015161154a565b610c4d5760405163c84a864d60e01b815260040160405180910390fd5b6109ca826040518060200160405280600081525061156f565b60005b81518110156109ca57610c94828281518110610c8757610c87613410565b6020026020010151610997565b600101610c69565b6060610750826116c0565b60005b8151811015610a0257610cef838281518110610cc857610cc8613410565b6020026020010151838381518110610ce257610ce2613410565b6020026020010151610e90565b600101610caa565b610cff611793565b6001600160a01b0316336001600160a01b031614610d305760405163efd1052d60e01b815260040160405180910390fd5b610d386117c6565b565b606061075082611800565b6000610d4f611793565b905090565b6107b0816118c8565b6000610d4f6118d2565b600061074d83836118fa565b600061074d838361154a565b7f832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b610da9816113a7565b610a02838361191f565b6001600160a01b0382163303610ddc57604051637b30a93360e11b815260040160405180910390fd5b3360008181527f1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080516020613857833981519152610e7f816113a7565b610e8a848484611a2d565b50505050565b7ffc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a610eba816113a7565b6000805160206138b7833981519152548310610ee9576040516301ca465760e71b815260040160405180910390fd5b610a028383611a65565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ea6020526040812054610750565b600080516020613857833981519152610f3e816113a7565b610e8a848484611ae6565b600061075082611c60565b610f5d826114a2565b610f66816113a7565b610a028383611c84565b6001600160a01b0391821660009081527f1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68c6020908152604080832093909416825291909152205460ff1690565b6000805160206138f783398151915254600203610fed57604051635db5c7cd60e11b815260040160405180910390fd5b61100460026000805160206138f783398151915255565b61101c6000805160206138578339815191528661154a565b1561103a5760405163a4e583af60e01b815260040160405180910390fd5b6110647f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8488561154a565b611081576040516372adea5560e11b815260040160405180910390fd5b6000838152600080516020613897833981519152602052604090205460ff166110bd57604051638b69d31f60e01b815260040160405180910390fd5b6110ca8585858585611ce6565b836001600160a01b0316856001600160a01b03167f805bf530142475cfb4c3eaecae0d042e3d819b3e2915ba5036e2819fe92ab27f8460405161110f91815260200190565b60405180910390a3610a5d60016000805160206138f783398151915255565b6111366118d2565b6001600160a01b0316336001600160a01b03161461116757604051632f7a8ee160e01b815260040160405180910390fd5b6107b081611d31565b60006001600160a01b0383166111995760405163db5d879760e01b815260040160405180910390fd5b6000805160206138d78339815191526000928352602090815260408084206001600160a01b0395909516845293905250205490565b60005b8251811015610a02576111fd8382815181106111ef576111ef613410565b60200260200101518361156f565b6001016111d1565b60608160000361122c5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561125657806112408161343c565b915061124f9050600a8361346b565b9150611230565b6000816001600160401b0381111561127057611270612a06565b6040519080825280601f01601f19166020018201604052801561129a576020820181803683370190505b5090505b8415611305576112af60018361347f565b91506112bc600a86613492565b6112c79060306134a6565b60f81b8183815181106112dc576112dc613410565b60200101906001600160f81b031916908160001a9053506112fe600a8661346b565b945061129e565b949350505050565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb6020526040812061075090611d72565b6001600160a01b038281166000818152600080516020613877833981519152602052604080822080546001600160a01b0319169486169485179055517f57e330d54e3668c90601656969884d7b4e3eefb3d3fb674b313c405b1bd33bc89190a35050565b6107b08133611d7c565b6113ca6000805160206138b78339815191525482611a65565b6000805160206138b783398151915280549060006113e78361343c565b909155505060408051825115158152602080840151908201527f87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9910160405180910390a150565b60008281527f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f5602052604090206114658282613501565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b826040516114969190612ca5565b60405180910390a25050565b6000908152600080516020613837833981519152602052604090206002015490565b6114d2868686868686611de7565b6114e0868686868686611f90565b505050505050565b60008281526000805160206138378339815191526020526040902061150d90826120a9565b5060405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526000805160206138378339815191526020526040812061074d90836120be565b815161157a906120e0565b60005b826020015151811015610a02576000805160206138b78339815191526001016000846020015183815181106115b4576115b4613410565b602002602001015160000151815260200190815260200160002060010154836020015182815181106115e8576115e8613410565b602002602001015160200151111561161357604051631eef750160e21b815260040160405180910390fd5b61166583600001518460200151838151811061163157611631613410565b6020026020010151600001518560200151848151811061165357611653613410565b60200260200101516020015185612116565b826020015160405161167791906135c0565b604051908190038120845190916001600160a01b039091169033907f42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e390600090a460010161157d565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb602052604081206060916116f982611d72565b6001600160401b0381111561171057611710612a06565b604051908082528060200260200182016040528015611739578160200160208202803683370190505b50905060005b61174883611d72565b81101561178b5761175983826121ef565b82828151811061176b5761176b613410565b6001600160a01b039092166020928302919091019091015260010161173f565b509392505050565b60007f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce66178905b546001600160a01b0316919050565b6117cf336121fb565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319169055565b6001600160a01b03811660009081527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ec6020526040812060609161184382611d72565b6001600160401b0381111561185a5761185a612a06565b604051908082528060200260200182016040528015611883578160200160208202803683370190505b50905060005b61189283611d72565b81101561178b576118a383826121ef565b8282815181106118b5576118b5613410565b6020908102919091010152600101611889565b6107b08133611c84565b60007f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f6716804606117b7565b60008281526000805160206138378339815191526020526040812061074d90836121ef565b6000805160206138f78339815191525460020361194f57604051635db5c7cd60e11b815260040160405180910390fd5b61196660026000805160206138f783398151915255565b6000611973836000610741565b90506000611982846001610741565b90506119a1848460008560405180602001604052806000815250611ce6565b6119be848460018460405180602001604052806000815250611ce6565b826001600160a01b0316846001600160a01b03167f5a418b0cf08f643a71a8bbd6807f2b525efadd21706c1e14d09f557d9ca3e19f8484604051611a0c929190918252602082015260400190565b60405180910390a350506109ca60016000805160206138f783398151915255565b60005b8251811015610e8a57611a5d84848381518110611a4f57611a4f613410565b602002602001015184611ae6565b600101611a30565b8051600083815260008051602061389783398151915260209081526040808320805460ff1916941515949094178455818501805160019095019490945580518551151581529351918401919091528051928390030182209184917f27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba91a35050565b6000805160206138f783398151915254600203611b1657604051635db5c7cd60e11b815260040160405180910390fd5b611b2d60026000805160206138f783398151915255565b8151611b38906120e0565b60005b826020015151811015611bce57611bc68460008051602061387783398151915285516001600160a01b03908116600090815260209283526040902054918701518051929091169185908110611b9257611b92613410565b60200260200101516000015186602001518581518110611bb457611bb4613410565b60200260200101516020015186611ce6565b600101611b3b565b508160200151604051611be191906135c0565b6040518091039020611bfe60008051602061387783398151915290565b83516001600160a01b039081166000908152602092909252604080832054905190821692918716917f96e1e27b000adc867e6fda1757d8650ff9f7377e0271df95c7f72c4f74f1251b91a4610a0260016000805160206138f783398151915255565b60008181526000805160206138378339815191526020526040812061075090611d72565b600082815260008051602061383783398151915260205260409020611ca99082612275565b5060405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b6001600160a01b0385163314801590611d065750611d048533610f70565b155b15611d23576040516212efed60e91b815260040160405180910390fd5b610a5d33868686868661228a565b6107b0817f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b03831617905550565b6000610750825490565b611d86828261154a565b6109ca57611d9c816001600160a01b03166122a6565b611da78360206122b8565b604051602001611db8929190613601565b60408051601f198184030181529082905262461bcd60e51b8252611dde91600401612ca5565b60405180910390fd5b6001600160a01b038416611e0e5760405163f5cadad560e01b815260040160405180910390fd5b8151835114611e3057604051633e7e0b6d60e11b815260040160405180910390fd5b611e3e86868686868661240a565b6000805160206138d783398151915260005b8451811015611f2f576000858281518110611e6d57611e6d613410565b602002602001015190506000858381518110611e8b57611e8b613410565b602090810291909101810151600084815286835260408082206001600160a01b038e168352909352919091205490915080821115611edc5760405163119ac6bb60e31b815260040160405180910390fd5b6000838152602086815260408083206001600160a01b038e811685529252808320938590039093558a168152908120805460019590950194839290611f229084906134a6565b90915550611e5092505050565b50846001600160a01b0316866001600160a01b0316886001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611f7f929190613676565b60405180910390a450505050505050565b6001600160a01b0384163b156114e05760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611fd490899089908890889088906004016136a4565b6020604051808303816000875af192505050801561200f575060408051601f3d908101601f1916820190925261200c91810190613702565b60015b61206f5761201b61371f565b806308c379a003612054575061202f61373b565b8061203a5750612056565b8060405162461bcd60e51b8152600401611dde9190612ca5565b505b60405163380147a960e01b815260040160405180910390fd5b6001600160e01b0319811663bc197c8160e01b146120a057604051633744db2960e01b815260040160405180910390fd5b50505050505050565b600061074d836001600160a01b038416612418565b6001600160a01b0381166000908152600183016020526040812054151561074d565b6001600160a01b0381811660009081526000805160206138778339815191526020526040902054166107b0576107b08182611343565b6001600160a01b03841661213d576040516301c8efbf60e11b815260040160405180910390fd5b61215c3360008661214d8761245b565b6121568761245b565b8661240a565b60008381526000805160206138d7833981519152602090815260408083206001600160a01b03881684529091528120805484929061219b9084906134a6565b909155505060408051848152602081018490526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b600061074d83836124a6565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546040516001600160a01b038481169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a380546001600160a01b0319166001600160a01b0392909216919091179055565b600061074d836001600160a01b0384166124f2565b6122988686868686866125b7565b6114e08686868686866126cd565b60606107506001600160a01b03831660145b606060006122c78360026137c4565b6122d29060026134a6565b6001600160401b038111156122e9576122e9612a06565b6040519080825280601f01601f191660200182016040528015612313576020820181803683370190505b509050600360fc1b8160008151811061232e5761232e613410565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061235d5761235d613410565b60200101906001600160f81b031916908160001a905350600160028402015b60018111156123ea576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106123ad576123ad613410565b1a60f81b8282815181106123c3576123c3613410565b60200101906001600160f81b031916908160001a90535060049490941c936000190161237c565b50831561074d5760405163c913478560e01b815260040160405180910390fd5b6114e0868686868686612789565b6000818152600183016020526040812054610750575081546001808201845560008481526020808220909301849055845493815293810190915260409092205590565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061249557612495613410565b602090810291909101015292915050565b815460009082106124ca5760405163e637bf3b60e01b815260040160405180910390fd5b8260000182815481106124df576124df613410565b9060005260206000200154905092915050565b600081815260018301602052604081205480156125b05783546000908590600019810190811061252457612524613410565b906000526020600020015490508085600001600184038154811061254a5761254a613410565b600091825260208083209091019290925591825260018601905260409020819055835484908061257c5761257c6137db565b6001900381819060005260206000200160009055905583600101600084815260200190815260200160002060009055600191505b5092915050565b6001600160a01b0384166125de5760405163f5cadad560e01b815260040160405180910390fd5b6125ed86868661214d8761245b565b60008381526000805160206138d7833981519152602081815260408084206001600160a01b038a168552909152909120548084111561263f5760405163119ac6bb60e31b815260040160405180910390fd5b6000858152602083815260408083206001600160a01b038b8116855292528083209387900390935587168152908120805485929061267e9084906134a6565b909155505060408051858152602081018590526001600160a01b038088169289821692918b16917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629101611f7f565b6001600160a01b0384163b156114e05760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061271190899089908890889088906004016137f1565b6020604051808303816000875af192505050801561274c575060408051601f3d908101601f1916820190925261274991810190613702565b60015b6127585761201b61371f565b6001600160e01b0319811663f23a6e6160e01b146120a057604051633744db2960e01b815260040160405180910390fd5b836001600160a01b0316856001600160a01b0316146114e0576001600160a01b0385811660009081527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ec6020526040808220928716825281207fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ea927fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb929091905b875181101561296857600087828151811061284757612847613410565b60200260200101519050600081111561295f57600089838151811061286e5761286e613410565b6020026020010151905060006001600160a01b03168c6001600160a01b0316036128bb57600081815260208890526040812080548492906128b09084906134a6565b909155506128f09050565b816128c68d83611170565b036128f05760008181526020879052604090206128e3908d612275565b506128ee8582612975565b505b6001600160a01b038b16612927576000818152602088905260408120805484929061291c90849061347f565b9091555061295d9050565b6129318b82611170565b60000361295d576000818152602087905260409020612950908c6120a9565b5061295b8482612981565b505b505b5060010161282a565b5050505050505050505050565b600061074d83836124f2565b600061074d8383612418565b80356001600160a01b03811681146129a457600080fd5b919050565b600080604083850312156129bc57600080fd5b6129c58361298d565b946020939093013593505050565b6001600160e01b0319811681146107b057600080fd5b6000602082840312156129fb57600080fd5b813561074d816129d3565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715612a3b57612a3b612a06565b60405250565b601f8201601f191681016001600160401b0381118282101715612a6657612a66612a06565b6040525050565b60006001600160401b03821115612a8657612a86612a06565b5060051b60200190565b60006040808385031215612aa357600080fd5b8051612aae81612a1c565b809250612aba8461298d565b81526020808501356001600160401b03811115612ad657600080fd5b8501601f81018713612ae757600080fd5b8035612af281612a6d565b8551612afe8282612a41565b82815260069290921b8301840191848101915089831115612b1e57600080fd5b928401925b82841015612b615786848b031215612b3b5760008081fd5b8651612b4681612a1c565b84358152858501358682015282529286019290840190612b23565b80858701525050505050505092915050565b600082601f830112612b8457600080fd5b81356020612b9182612a6d565b604051612b9e8282612a41565b83815260059390931b8501820192828101915086841115612bbe57600080fd5b8286015b84811015612bfd5780356001600160401b03811115612be15760008081fd5b612bef8986838b0101612a90565b845250918301918301612bc2565b509695505050505050565b600060208284031215612c1a57600080fd5b81356001600160401b03811115612c3057600080fd5b61130584828501612b73565b600060208284031215612c4e57600080fd5b5035919050565b60005b83811015612c70578181015183820152602001612c58565b50506000910152565b60008151808452612c91816020860160208601612c55565b601f01601f19169290920160200192915050565b60208152600061074d6020830184612c79565b600060208284031215612cca57600080fd5b61074d8261298d565b803580151581146129a457600080fd5b600060408284031215612cf557600080fd5b604051612d0181612a1c565b809150612d0d83612cd3565b8152602083013560208201525092915050565b600060408284031215612d3257600080fd5b61074d8383612ce3565b60006001600160401b03831115612d5557612d55612a06565b604051612d6c601f8501601f191660200182612a41565b809150838152848484011115612d8157600080fd5b83836020830137600060208583010152509392505050565b60008060408385031215612dac57600080fd5b8235915060208301356001600160401b03811115612dc957600080fd5b8301601f81018513612dda57600080fd5b612de985823560208401612d3c565b9150509250929050565b600082601f830112612e0457600080fd5b81356020612e1182612a6d565b604051612e1e8282612a41565b80915083815260208101915060208460051b870101935086841115612e4257600080fd5b602086015b84811015612bfd5780358352918301918301612e47565b600082601f830112612e6f57600080fd5b61074d83833560208501612d3c565b600080600080600060a08688031215612e9657600080fd5b612e9f8661298d565b9450612ead6020870161298d565b935060408601356001600160401b0380821115612ec957600080fd5b612ed589838a01612df3565b94506060880135915080821115612eeb57600080fd5b612ef789838a01612df3565b93506080880135915080821115612f0d57600080fd5b50612f1a88828901612e5e565b9150509295509295909350565b60008060408385031215612f3a57600080fd5b82359150612f4a6020840161298d565b90509250929050565b60008060408385031215612f6657600080fd5b82356001600160401b0380821115612f7d57600080fd5b818501915085601f830112612f9157600080fd5b81356020612f9e82612a6d565b604051612fab8282612a41565b83815260059390931b8501820192828101915089841115612fcb57600080fd5b948201945b83861015612ff057612fe18661298d565b82529482019490820190612fd0565b9650508601359250508082111561300657600080fd5b50612de985828601612df3565b60008151808452602080850194506020840160005b8381101561304457815187529582019590820190600101613028565b509495945050505050565b60208152600061074d6020830184613013565b60006020828403121561307457600080fd5b81356001600160401b0381111561308a57600080fd5b61130584828501612a90565b600082601f8301126130a757600080fd5b813560206130b482612a6d565b604080516130c28382612a41565b80925084815260208101925060208560061b8801019450878511156130e657600080fd5b602087015b8581101561310a576130fd8982612ce3565b84529284019282016130eb565b50979650505050505050565b60006020828403121561312857600080fd5b81356001600160401b0381111561313e57600080fd5b61130584828501613096565b6020808252825182820181905260009190848201906040850190845b8181101561318b5783516001600160a01b031683529284019291840191600101613166565b50909695505050505050565b600080604083850312156131aa57600080fd5b82356001600160401b03808211156131c157600080fd5b6131cd86838701612df3565b935060208501359150808211156131e357600080fd5b50612de985828601613096565b6000806040838503121561320357600080fd5b50508035926020909101359150565b6000806040838503121561322557600080fd5b61322e8361298d565b9150612f4a6020840161298d565b6000806040838503121561324f57600080fd5b6132588361298d565b9150612f4a60208401612cd3565b60008060006060848603121561327b57600080fd5b6132848461298d565b925060208401356001600160401b03808211156132a057600080fd5b6132ac87838801612b73565b935060408601359150808211156132c257600080fd5b506132cf86828701612e5e565b9150509250925092565b600080606083850312156132ec57600080fd5b82359150612f4a8460208501612ce3565b60008060006060848603121561331257600080fd5b61331b8461298d565b925060208401356001600160401b038082111561333757600080fd5b6132ac87838801612a90565b600080600080600060a0868803121561335b57600080fd5b6133648661298d565b94506133726020870161298d565b9350604086013592506060860135915060808601356001600160401b0381111561339b57600080fd5b612f1a88828901612e5e565b600181811c908216806133bb57607f821691505b6020821081036133db57634e487b7160e01b600052602260045260246000fd5b50919050565b600083516133f3818460208801612c55565b835190830190613407818360208801612c55565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161344e5761344e613426565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261347a5761347a613455565b500490565b8181038181111561075057610750613426565b6000826134a1576134a1613455565b500690565b8082018082111561075057610750613426565b601f821115610a02576000816000526020600020601f850160051c810160208610156134e25750805b601f850160051c820191505b818110156114e0578281556001016134ee565b81516001600160401b0381111561351a5761351a612a06565b61352e8161352884546133a7565b846134b9565b602080601f831160018114613563576000841561354b5750858301515b600019600386901b1c1916600185901b1785556114e0565b600085815260208120601f198616915b8281101561359257888601518255948401946001909101908401613573565b50858210156135b05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b815160009082906020808601845b838110156135f55781518051865283015183860152604090940193908201906001016135ce565b50929695505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613639816017850160208801612c55565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161366a816028840160208801612c55565b01602801949350505050565b6040815260006136896040830185613013565b828103602084015261369b8185613013565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906136d090830186613013565b82810360608401526136e28186613013565b905082810360808401526136f68185612c79565b98975050505050505050565b60006020828403121561371457600080fd5b815161074d816129d3565b600060033d11156137385760046000803e5060005160e01c5b90565b600060443d10156137495790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561377857505050505090565b82850191508151818111156137905750505050505090565b843d87010160208285010111156137aa5750505050505090565b6137b960208286010187612a41565b509095945050505050565b808202811582820484141761075057610750613426565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061382b90830184612c79565b97965050505050505056fed3889cc5458b268d0544e5534672df1296288ca3f93cbd39bd6f497a5c622811fbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c74392e177520418e6f87f79a16f906a1486466a2682623913688b2e8a8ea3aad156e11ec25828e1d37e7012fb60d670d0c2e6c7b9b5a25209c94dffa2313dc4f156e11ec25828e1d37e7012fb60d670d0c2e6c7b9b5a25209c94dffa2313dc4e1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68b09acf4e54214992e70883cf7dcd6957ff2c71cd9e14df4bec4383bc0d11607dca264697066735822122026f5cef95ce4370f3537e3d8fa34b140aa96dafa99926b7695db7b6209d5b8ba64736f6c6343000816003300000000000000000000000062286d694f89a1b12c0214bfcd567bb6c29514910000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de100000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x0" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776300000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x1" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15dfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x2" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310400000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x3" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a600000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x4" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15dfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x5" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x6" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776300000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15dfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x8" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310400000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x9" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a600000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xa" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15dfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xb" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xc" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "batchCreateTokens((bool,uint256)[])", - "arguments": [ - "[(false, 100), (true, 100)]" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x29f49", - "value": "0x0", - "data": "0x5c18ca8b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064", - "nonce": "0xd" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "setTokenURI(uint256,string)", - "arguments": [ - "0", - "\"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/0\"" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x27cb0", - "value": "0x0", - "data": "0x162094c4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3000000000000000000000000000000000000000000000000000000000", - "nonce": "0xe" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "setTokenURI(uint256,string)", - "arguments": [ - "1", - "\"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/1\"" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x27cc1", - "value": "0x0", - "data": "0x162094c4000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3100000000000000000000000000000000000000000000000000000000", - "nonce": "0xf" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "mint((address,(uint256,uint256)[]))", - "arguments": [ - "(0x62286D694F89a1B12c0214bfcD567bb6c2951491, [(0, 50), (1, 50)])" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x89bfe", - "value": "0x0", - "data": "0x5a449111000000000000000000000000000000000000000000000000000000000000002000000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032", - "nonce": "0x10" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionIndex": "0x53", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": null, - "cumulativeGasUsed": "0x11a1572", - "gasUsed": "0x3378f3", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionIndex": "0x53", - "logIndex": "0x69", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionIndex": "0x53", - "logIndex": "0x6a", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000020000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionIndex": "0x54", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11b8bf3", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionIndex": "0x54", - "logIndex": "0x6b", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000080000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000800000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionIndex": "0x55", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11d0274", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionIndex": "0x55", - "logIndex": "0x6c", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionIndex": "0x56", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11e78f5", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionIndex": "0x56", - "logIndex": "0x6d", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000001000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionIndex": "0x57", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11fef76", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionIndex": "0x57", - "logIndex": "0x6e", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000001000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionIndex": "0x58", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12165f7", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionIndex": "0x58", - "logIndex": "0x6f", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000004000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionIndex": "0x59", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x122dc78", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionIndex": "0x59", - "logIndex": "0x70", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00001004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionIndex": "0x5a", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x124102d", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionIndex": "0x5a", - "logIndex": "0x71", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000080000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000800000000000000000000000000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionIndex": "0x5b", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12543e2", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionIndex": "0x5b", - "logIndex": "0x72", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000400000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionIndex": "0x5c", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x1267797", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionIndex": "0x5c", - "logIndex": "0x73", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000020000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000201000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionIndex": "0x5d", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x127ab4c", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionIndex": "0x5d", - "logIndex": "0x74", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000004000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000001000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionIndex": "0x5e", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x128df01", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionIndex": "0x5e", - "logIndex": "0x75", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000004000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionIndex": "0x5f", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12a12b6", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionIndex": "0x5f", - "logIndex": "0x76", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00001004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12bf8b6", - "gasUsed": "0x1e600", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x64295d14d9ee49959a21ba32d5dc243e7e41287ccc6b56899ff62dae58b1951a" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x77", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x78", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba", - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x84d38288bfc2d0dbffb953282e4834a72a7fd5e9f8000d46139e8490d63b1338" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x79", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x7a", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200000000000000000000000000040000000000400000000000080000000000000000000000000000000000000000800000000000000040000008000000000000000000000000000080000000000040000000000000000000000000000020000008000000000000800000000000000000000001000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000010000000000000000000000000020000000000000000000000000000000000001000000000000000000000000000000000000100000060001000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionIndex": "0x61", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12dc5aa", - "gasUsed": "0x1ccf4", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionIndex": "0x61", - "logIndex": "0x7b", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000020000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000020000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionIndex": "0x62", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12f92aa", - "gasUsed": "0x1cd00", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b", - "0x0000000000000000000000000000000000000000000000000000000000000001" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3100000000000000000000000000000000000000000000000000000000", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionIndex": "0x62", - "logIndex": "0x7c", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000010000000020000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000040000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x13575ab", - "gasUsed": "0x5e301", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x57e330d54e3668c90601656969884d7b4e3eefb3d3fb674b313c405b1bd33bc8", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x7d", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x7e", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e3", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0xd7ea3f5e1d5a40d6b02cdc7c631ff4612aa6a1709395548cd15565e7640fab5c" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x7f", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x80", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e3", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0xd7ea3f5e1d5a40d6b02cdc7c631ff4612aa6a1709395548cd15565e7640fab5c" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x81", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200800000000000000000000000000000000000000000000000440000010000000000000000040000000000000000000000000000004002000000000000000001000000000000000000000000000000000000000000000000000000000020000001000000000000800000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000000000000000000000000000008000000000100000020000000000400000040000000000200000000000000000000000000080000000080", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1708665001, - "chain": 11155111, - "multi": false, - "commit": "7423c19" -} \ No newline at end of file diff --git a/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-latest.json b/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-latest.json deleted file mode 100644 index 3fad0a2..0000000 --- a/packages/foundry/broadcast/DeployDemo.s.sol/11155111/run-latest.json +++ /dev/null @@ -1,1060 +0,0 @@ -{ - "transactions": [ - { - "hash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionType": "CREATE", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": null, - "arguments": [ - "0x62286D694F89a1B12c0214bfcD567bb6c2951491", - "[0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1, 0x62286D694F89a1B12c0214bfcD567bb6c2951491]" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "gas": "0x42e513", - "value": "0x0", - "data": "0x60806040523480156200001157600080fd5b5060405162003c5238038062003c528339810160408190526200003491620001f7565b62000040828262000048565b5050620002f6565b62000053826200009f565b60005b81518110156200009a57620000916000801b8383815181106200007d576200007d620002e0565b6020026020010151620000ad60201b60201c565b60010162000056565b505050565b620000aa8162000123565b50565b60008281527fd3889cc5458b268d0544e5534672df1296288ca3f93cbd39bd6f497a5c62281160205260409020620000e6908262000160565b5060405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b03831617905550565b600062000177836001600160a01b03841662000180565b90505b92915050565b60008181526001830160205260408120546200017a575081546001808201845560008481526020808220909301849055845493815293810190915260409092205590565b80516001600160a01b0381168114620001dc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200020b57600080fd5b6200021683620001c4565b602084810151919350906001600160401b03808211156200023657600080fd5b818601915086601f8301126200024b57600080fd5b815181811115620002605762000260620001e1565b8060051b604051601f19603f83011681018181108582111715620002885762000288620001e1565b604052918252848201925083810185019189831115620002a757600080fd5b938501935b82851015620002d057620002c085620001c4565b84529385019392850192620002ac565b8096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b61394c80620003066000396000f3fe608060405234801561001057600080fd5b506004361061027e5760003560e01c806379ba50971161015c578063b9ebd670116100ce578063d547741f11610087578063d547741f146106cb578063e951c5ab146106de578063e985e9c5146106f3578063f0bd87cc14610706578063f242432a1461071b578063f2fde38b1461072e57600080fd5b8063b9ebd67014610631578063bd85b03914610644578063c660531314610657578063ca15c8731461066a578063caa2fe321461067d578063d5391393146106a457600080fd5b80638da5cb5b116101205780638da5cb5b146105ca5780639010d07c146105d257806391d14854146105e557806398d3b6d3146105f8578063a22cb4651461060b578063aa05af231461061e57600080fd5b806379ba50971461056d57806385bff2e7146105755780638ab5150a146105885780638ada943b146105905780638bb9c5bf146105b757600080fd5b80632f2ff15d116101f55780634edea111116101b95780634edea111146104755780635a449111146104ed5780635c18ca8b146105005780635e882316146105135780636dcfd8411461053a57806377fe53f61461055a57600080fd5b80632f2ff15d1461039a5780633b2a8587146103ad578063412fc1fa146103fe5780634797c5871461042e5780634e1273f41461045557600080fd5b806313fa095f1161024757806313fa095f1461031457806314aefd3814610327578063162094c41461033a578063248a9ca31461034d578063282c51f3146103605780632eb2c2d61461038757600080fd5b8062fdd58e1461028357806301ffc9a7146102a957806303fe26f7146102cc5780630e89341c146102e157806313ba55df14610301575b600080fd5b6102966102913660046129a9565b610741565b6040519081526020015b60405180910390f35b6102bc6102b73660046129e9565b610756565b60405190151581526020016102a0565b6102df6102da366004612c08565b610797565b005b6102f46102ef366004612c3c565b6107b3565b6040516102a09190612ca5565b61029661030f366004612c3c565b610982565b6102df610322366004612cb8565b61098d565b6102df610335366004612d20565b610997565b6102df610348366004612d99565b6109ce565b61029661035b366004612c3c565b610a07565b6102967f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b6102df610395366004612e7e565b610a12565b6102df6103a8366004612f27565b610a64565b6103e66103bb366004612cb8565b6001600160a01b03908116600090815260008051602061387783398151915260205260409020541690565b6040516001600160a01b0390911681526020016102a0565b61029661040c366004612c3c565b6000908152600080516020613897833981519152602052604090206001015490565b6102967f60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776381565b610468610463366004612f53565b610a80565b6040516102a0919061304f565b6104d0610483366004612c3c565b604080518082018252600080825260209182018190529283526000805160206138978339815191528152918190208151808301909252805460ff1615158252600101549181019190915290565b6040805182511515815260209283015192810192909252016102a0565b6102df6104fb366004613062565b610bea565b6102df61050e366004613116565b610c66565b6102967f9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310481565b61054d610548366004612c3c565b610c9c565b6040516102a0919061314a565b6102df610568366004613197565b610ca7565b6102df610cf7565b610468610583366004612cb8565b610d3a565b6103e6610d45565b6102967f832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b81565b6102df6105c5366004612c3c565b610d54565b6103e6610d5d565b6103e66105e03660046131f0565b610d67565b6102bc6105f3366004612f27565b610d73565b6102df610606366004613212565b610d7f565b6102df61061936600461323c565b610db3565b6102df61062c366004613266565b610e67565b6102df61063f3660046132d9565b610e90565b610296610652366004612c3c565b610ef3565b6102df6106653660046132fd565b610f26565b610296610678366004612c3c565b610f49565b6102967ffc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a81565b6102967f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6102df6106d9366004612f27565b610f54565b6000805160206138b783398151915254610296565b6102bc610701366004613212565b610f70565b61029660008051602061385783398151915281565b6102df610729366004613343565b610fbd565b6102df61073c366004612cb8565b61112e565b600061074d8383611170565b90505b92915050565b6001600160e01b0319811660009081527ffc606c433378e3a7e0a6a531deac289b66caa1b4aa8554fd4ab2c6f1570f92d8602052604081205460ff16610750565b6107b081604051806020016040528060008152506111ce565b50565b60008181527f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f56020526040812080546060927f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f4929091610812906133a7565b80601f016020809104026020016040519081016040528092919081815260200182805461083e906133a7565b801561088b5780601f106108605761010080835404028352916020019161088b565b820191906000526020600020905b81548152906001019060200180831161086e57829003601f168201915b5050505050905060008260000180546108a3906133a7565b80601f01602080910402602001604051908101604052809291908181526020018280546108cf906133a7565b801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b50505050509050805160000361093457509392505050565b81511561096757808260405160200161094e9291906133e1565b6040516020818303038152906040529350505050919050565b8061097186611205565b60405160200161094e9291906133e1565b60006107508261130d565b6107b03382611343565b7f60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d177636109c1816113a7565b6109ca826113b1565b5050565b7f9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece35831046109f8816113a7565b610a02838361142e565b505050565b6000610750826114a2565b6001600160a01b0385163314801590610a325750610a308533610f70565b155b15610a4f576040516212efed60e91b815260040160405180910390fd5b610a5d3386868686866114c4565b5050505050565b610a6d826114a2565b610a76816113a7565b610a0283836114e8565b60608151835114610aa457604051633e7e0b6d60e11b815260040160405180910390fd5b82516000805160206138d7833981519152906000906001600160401b03811115610ad057610ad0612a06565b604051908082528060200260200182016040528015610af9578160200160208202803683370190505b50905060005b8551811015610be15760006001600160a01b0316868281518110610b2557610b25613410565b60200260200101516001600160a01b031603610b545760405163db5d879760e01b815260040160405180910390fd5b826000868381518110610b6957610b69613410565b602002602001015181526020019081526020016000206000878381518110610b9357610b93613410565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002054828281518110610bce57610bce613410565b6020908102919091010152600101610aff565b50949350505050565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6610c14816113a7565b610c30600080516020613857833981519152836000015161154a565b610c4d5760405163c84a864d60e01b815260040160405180910390fd5b6109ca826040518060200160405280600081525061156f565b60005b81518110156109ca57610c94828281518110610c8757610c87613410565b6020026020010151610997565b600101610c69565b6060610750826116c0565b60005b8151811015610a0257610cef838281518110610cc857610cc8613410565b6020026020010151838381518110610ce257610ce2613410565b6020026020010151610e90565b600101610caa565b610cff611793565b6001600160a01b0316336001600160a01b031614610d305760405163efd1052d60e01b815260040160405180910390fd5b610d386117c6565b565b606061075082611800565b6000610d4f611793565b905090565b6107b0816118c8565b6000610d4f6118d2565b600061074d83836118fa565b600061074d838361154a565b7f832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b610da9816113a7565b610a02838361191f565b6001600160a01b0382163303610ddc57604051637b30a93360e11b815260040160405180910390fd5b3360008181527f1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68c602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080516020613857833981519152610e7f816113a7565b610e8a848484611a2d565b50505050565b7ffc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a610eba816113a7565b6000805160206138b7833981519152548310610ee9576040516301ca465760e71b815260040160405180910390fd5b610a028383611a65565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ea6020526040812054610750565b600080516020613857833981519152610f3e816113a7565b610e8a848484611ae6565b600061075082611c60565b610f5d826114a2565b610f66816113a7565b610a028383611c84565b6001600160a01b0391821660009081527f1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68c6020908152604080832093909416825291909152205460ff1690565b6000805160206138f783398151915254600203610fed57604051635db5c7cd60e11b815260040160405180910390fd5b61100460026000805160206138f783398151915255565b61101c6000805160206138578339815191528661154a565b1561103a5760405163a4e583af60e01b815260040160405180910390fd5b6110647f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a8488561154a565b611081576040516372adea5560e11b815260040160405180910390fd5b6000838152600080516020613897833981519152602052604090205460ff166110bd57604051638b69d31f60e01b815260040160405180910390fd5b6110ca8585858585611ce6565b836001600160a01b0316856001600160a01b03167f805bf530142475cfb4c3eaecae0d042e3d819b3e2915ba5036e2819fe92ab27f8460405161110f91815260200190565b60405180910390a3610a5d60016000805160206138f783398151915255565b6111366118d2565b6001600160a01b0316336001600160a01b03161461116757604051632f7a8ee160e01b815260040160405180910390fd5b6107b081611d31565b60006001600160a01b0383166111995760405163db5d879760e01b815260040160405180910390fd5b6000805160206138d78339815191526000928352602090815260408084206001600160a01b0395909516845293905250205490565b60005b8251811015610a02576111fd8382815181106111ef576111ef613410565b60200260200101518361156f565b6001016111d1565b60608160000361122c5750506040805180820190915260018152600360fc1b602082015290565b8160005b811561125657806112408161343c565b915061124f9050600a8361346b565b9150611230565b6000816001600160401b0381111561127057611270612a06565b6040519080825280601f01601f19166020018201604052801561129a576020820181803683370190505b5090505b8415611305576112af60018361347f565b91506112bc600a86613492565b6112c79060306134a6565b60f81b8183815181106112dc576112dc613410565b60200101906001600160f81b031916908160001a9053506112fe600a8661346b565b945061129e565b949350505050565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb6020526040812061075090611d72565b6001600160a01b038281166000818152600080516020613877833981519152602052604080822080546001600160a01b0319169486169485179055517f57e330d54e3668c90601656969884d7b4e3eefb3d3fb674b313c405b1bd33bc89190a35050565b6107b08133611d7c565b6113ca6000805160206138b78339815191525482611a65565b6000805160206138b783398151915280549060006113e78361343c565b909155505060408051825115158152602080840151908201527f87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9910160405180910390a150565b60008281527f4281b61aefbe70b3d3f684b428efca5f33077bc240e76f2808f9177c307617f5602052604090206114658282613501565b50817f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b826040516114969190612ca5565b60405180910390a25050565b6000908152600080516020613837833981519152602052604090206002015490565b6114d2868686868686611de7565b6114e0868686868686611f90565b505050505050565b60008281526000805160206138378339815191526020526040902061150d90826120a9565b5060405133906001600160a01b0383169084907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d90600090a45050565b60008281526000805160206138378339815191526020526040812061074d90836120be565b815161157a906120e0565b60005b826020015151811015610a02576000805160206138b78339815191526001016000846020015183815181106115b4576115b4613410565b602002602001015160000151815260200190815260200160002060010154836020015182815181106115e8576115e8613410565b602002602001015160200151111561161357604051631eef750160e21b815260040160405180910390fd5b61166583600001518460200151838151811061163157611631613410565b6020026020010151600001518560200151848151811061165357611653613410565b60200260200101516020015185612116565b826020015160405161167791906135c0565b604051908190038120845190916001600160a01b039091169033907f42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e390600090a460010161157d565b60008181527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb602052604081206060916116f982611d72565b6001600160401b0381111561171057611710612a06565b604051908082528060200260200182016040528015611739578160200160208202803683370190505b50905060005b61174883611d72565b81101561178b5761175983826121ef565b82828151811061176b5761176b613410565b6001600160a01b039092166020928302919091019091015260010161173f565b509392505050565b60007f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce66178905b546001600160a01b0316919050565b6117cf336121fb565b7f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319169055565b6001600160a01b03811660009081527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ec6020526040812060609161184382611d72565b6001600160401b0381111561185a5761185a612a06565b604051908082528060200260200182016040528015611883578160200160208202803683370190505b50905060005b61189283611d72565b81101561178b576118a383826121ef565b8282815181106118b5576118b5613410565b6020908102919091010152600101611889565b6107b08133611c84565b60007f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f6716804606117b7565b60008281526000805160206138378339815191526020526040812061074d90836121ef565b6000805160206138f78339815191525460020361194f57604051635db5c7cd60e11b815260040160405180910390fd5b61196660026000805160206138f783398151915255565b6000611973836000610741565b90506000611982846001610741565b90506119a1848460008560405180602001604052806000815250611ce6565b6119be848460018460405180602001604052806000815250611ce6565b826001600160a01b0316846001600160a01b03167f5a418b0cf08f643a71a8bbd6807f2b525efadd21706c1e14d09f557d9ca3e19f8484604051611a0c929190918252602082015260400190565b60405180910390a350506109ca60016000805160206138f783398151915255565b60005b8251811015610e8a57611a5d84848381518110611a4f57611a4f613410565b602002602001015184611ae6565b600101611a30565b8051600083815260008051602061389783398151915260209081526040808320805460ff1916941515949094178455818501805160019095019490945580518551151581529351918401919091528051928390030182209184917f27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba91a35050565b6000805160206138f783398151915254600203611b1657604051635db5c7cd60e11b815260040160405180910390fd5b611b2d60026000805160206138f783398151915255565b8151611b38906120e0565b60005b826020015151811015611bce57611bc68460008051602061387783398151915285516001600160a01b03908116600090815260209283526040902054918701518051929091169185908110611b9257611b92613410565b60200260200101516000015186602001518581518110611bb457611bb4613410565b60200260200101516020015186611ce6565b600101611b3b565b508160200151604051611be191906135c0565b6040518091039020611bfe60008051602061387783398151915290565b83516001600160a01b039081166000908152602092909252604080832054905190821692918716917f96e1e27b000adc867e6fda1757d8650ff9f7377e0271df95c7f72c4f74f1251b91a4610a0260016000805160206138f783398151915255565b60008181526000805160206138378339815191526020526040812061075090611d72565b600082815260008051602061383783398151915260205260409020611ca99082612275565b5060405133906001600160a01b0383169084907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b90600090a45050565b6001600160a01b0385163314801590611d065750611d048533610f70565b155b15611d23576040516212efed60e91b815260040160405180910390fd5b610a5d33868686868661228a565b6107b0817f24aa1f7b31fd188a8d3ecfb06bc55c806040e59b03bd4396283442fce661789080546001600160a01b0319166001600160a01b03831617905550565b6000610750825490565b611d86828261154a565b6109ca57611d9c816001600160a01b03166122a6565b611da78360206122b8565b604051602001611db8929190613601565b60408051601f198184030181529082905262461bcd60e51b8252611dde91600401612ca5565b60405180910390fd5b6001600160a01b038416611e0e5760405163f5cadad560e01b815260040160405180910390fd5b8151835114611e3057604051633e7e0b6d60e11b815260040160405180910390fd5b611e3e86868686868661240a565b6000805160206138d783398151915260005b8451811015611f2f576000858281518110611e6d57611e6d613410565b602002602001015190506000858381518110611e8b57611e8b613410565b602090810291909101810151600084815286835260408082206001600160a01b038e168352909352919091205490915080821115611edc5760405163119ac6bb60e31b815260040160405180910390fd5b6000838152602086815260408083206001600160a01b038e811685529252808320938590039093558a168152908120805460019590950194839290611f229084906134a6565b90915550611e5092505050565b50846001600160a01b0316866001600160a01b0316886001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611f7f929190613676565b60405180910390a450505050505050565b6001600160a01b0384163b156114e05760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611fd490899089908890889088906004016136a4565b6020604051808303816000875af192505050801561200f575060408051601f3d908101601f1916820190925261200c91810190613702565b60015b61206f5761201b61371f565b806308c379a003612054575061202f61373b565b8061203a5750612056565b8060405162461bcd60e51b8152600401611dde9190612ca5565b505b60405163380147a960e01b815260040160405180910390fd5b6001600160e01b0319811663bc197c8160e01b146120a057604051633744db2960e01b815260040160405180910390fd5b50505050505050565b600061074d836001600160a01b038416612418565b6001600160a01b0381166000908152600183016020526040812054151561074d565b6001600160a01b0381811660009081526000805160206138778339815191526020526040902054166107b0576107b08182611343565b6001600160a01b03841661213d576040516301c8efbf60e11b815260040160405180910390fd5b61215c3360008661214d8761245b565b6121568761245b565b8661240a565b60008381526000805160206138d7833981519152602090815260408083206001600160a01b03881684529091528120805484929061219b9084906134a6565b909155505060408051848152602081018490526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b600061074d83836124a6565b7f8a22373512790c48b83a1fe2efdd2888d4a917bcdc24d0adf63e60f67168046080546040516001600160a01b038481169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a380546001600160a01b0319166001600160a01b0392909216919091179055565b600061074d836001600160a01b0384166124f2565b6122988686868686866125b7565b6114e08686868686866126cd565b60606107506001600160a01b03831660145b606060006122c78360026137c4565b6122d29060026134a6565b6001600160401b038111156122e9576122e9612a06565b6040519080825280601f01601f191660200182016040528015612313576020820181803683370190505b509050600360fc1b8160008151811061232e5761232e613410565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061235d5761235d613410565b60200101906001600160f81b031916908160001a905350600160028402015b60018111156123ea576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106123ad576123ad613410565b1a60f81b8282815181106123c3576123c3613410565b60200101906001600160f81b031916908160001a90535060049490941c936000190161237c565b50831561074d5760405163c913478560e01b815260040160405180910390fd5b6114e0868686868686612789565b6000818152600183016020526040812054610750575081546001808201845560008481526020808220909301849055845493815293810190915260409092205590565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061249557612495613410565b602090810291909101015292915050565b815460009082106124ca5760405163e637bf3b60e01b815260040160405180910390fd5b8260000182815481106124df576124df613410565b9060005260206000200154905092915050565b600081815260018301602052604081205480156125b05783546000908590600019810190811061252457612524613410565b906000526020600020015490508085600001600184038154811061254a5761254a613410565b600091825260208083209091019290925591825260018601905260409020819055835484908061257c5761257c6137db565b6001900381819060005260206000200160009055905583600101600084815260200190815260200160002060009055600191505b5092915050565b6001600160a01b0384166125de5760405163f5cadad560e01b815260040160405180910390fd5b6125ed86868661214d8761245b565b60008381526000805160206138d7833981519152602081815260408084206001600160a01b038a168552909152909120548084111561263f5760405163119ac6bb60e31b815260040160405180910390fd5b6000858152602083815260408083206001600160a01b038b8116855292528083209387900390935587168152908120805485929061267e9084906134a6565b909155505060408051858152602081018590526001600160a01b038088169289821692918b16917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f629101611f7f565b6001600160a01b0384163b156114e05760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061271190899089908890889088906004016137f1565b6020604051808303816000875af192505050801561274c575060408051601f3d908101601f1916820190925261274991810190613702565b60015b6127585761201b61371f565b6001600160e01b0319811663f23a6e6160e01b146120a057604051633744db2960e01b815260040160405180910390fd5b836001600160a01b0316856001600160a01b0316146114e0576001600160a01b0385811660009081527fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ec6020526040808220928716825281207fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424ea927fb31c2c74f86ca3ce94d901f5f5bbe66f7161eec2f7b5aa0b75a86371436424eb929091905b875181101561296857600087828151811061284757612847613410565b60200260200101519050600081111561295f57600089838151811061286e5761286e613410565b6020026020010151905060006001600160a01b03168c6001600160a01b0316036128bb57600081815260208890526040812080548492906128b09084906134a6565b909155506128f09050565b816128c68d83611170565b036128f05760008181526020879052604090206128e3908d612275565b506128ee8582612975565b505b6001600160a01b038b16612927576000818152602088905260408120805484929061291c90849061347f565b9091555061295d9050565b6129318b82611170565b60000361295d576000818152602087905260409020612950908c6120a9565b5061295b8482612981565b505b505b5060010161282a565b5050505050505050505050565b600061074d83836124f2565b600061074d8383612418565b80356001600160a01b03811681146129a457600080fd5b919050565b600080604083850312156129bc57600080fd5b6129c58361298d565b946020939093013593505050565b6001600160e01b0319811681146107b057600080fd5b6000602082840312156129fb57600080fd5b813561074d816129d3565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715612a3b57612a3b612a06565b60405250565b601f8201601f191681016001600160401b0381118282101715612a6657612a66612a06565b6040525050565b60006001600160401b03821115612a8657612a86612a06565b5060051b60200190565b60006040808385031215612aa357600080fd5b8051612aae81612a1c565b809250612aba8461298d565b81526020808501356001600160401b03811115612ad657600080fd5b8501601f81018713612ae757600080fd5b8035612af281612a6d565b8551612afe8282612a41565b82815260069290921b8301840191848101915089831115612b1e57600080fd5b928401925b82841015612b615786848b031215612b3b5760008081fd5b8651612b4681612a1c565b84358152858501358682015282529286019290840190612b23565b80858701525050505050505092915050565b600082601f830112612b8457600080fd5b81356020612b9182612a6d565b604051612b9e8282612a41565b83815260059390931b8501820192828101915086841115612bbe57600080fd5b8286015b84811015612bfd5780356001600160401b03811115612be15760008081fd5b612bef8986838b0101612a90565b845250918301918301612bc2565b509695505050505050565b600060208284031215612c1a57600080fd5b81356001600160401b03811115612c3057600080fd5b61130584828501612b73565b600060208284031215612c4e57600080fd5b5035919050565b60005b83811015612c70578181015183820152602001612c58565b50506000910152565b60008151808452612c91816020860160208601612c55565b601f01601f19169290920160200192915050565b60208152600061074d6020830184612c79565b600060208284031215612cca57600080fd5b61074d8261298d565b803580151581146129a457600080fd5b600060408284031215612cf557600080fd5b604051612d0181612a1c565b809150612d0d83612cd3565b8152602083013560208201525092915050565b600060408284031215612d3257600080fd5b61074d8383612ce3565b60006001600160401b03831115612d5557612d55612a06565b604051612d6c601f8501601f191660200182612a41565b809150838152848484011115612d8157600080fd5b83836020830137600060208583010152509392505050565b60008060408385031215612dac57600080fd5b8235915060208301356001600160401b03811115612dc957600080fd5b8301601f81018513612dda57600080fd5b612de985823560208401612d3c565b9150509250929050565b600082601f830112612e0457600080fd5b81356020612e1182612a6d565b604051612e1e8282612a41565b80915083815260208101915060208460051b870101935086841115612e4257600080fd5b602086015b84811015612bfd5780358352918301918301612e47565b600082601f830112612e6f57600080fd5b61074d83833560208501612d3c565b600080600080600060a08688031215612e9657600080fd5b612e9f8661298d565b9450612ead6020870161298d565b935060408601356001600160401b0380821115612ec957600080fd5b612ed589838a01612df3565b94506060880135915080821115612eeb57600080fd5b612ef789838a01612df3565b93506080880135915080821115612f0d57600080fd5b50612f1a88828901612e5e565b9150509295509295909350565b60008060408385031215612f3a57600080fd5b82359150612f4a6020840161298d565b90509250929050565b60008060408385031215612f6657600080fd5b82356001600160401b0380821115612f7d57600080fd5b818501915085601f830112612f9157600080fd5b81356020612f9e82612a6d565b604051612fab8282612a41565b83815260059390931b8501820192828101915089841115612fcb57600080fd5b948201945b83861015612ff057612fe18661298d565b82529482019490820190612fd0565b9650508601359250508082111561300657600080fd5b50612de985828601612df3565b60008151808452602080850194506020840160005b8381101561304457815187529582019590820190600101613028565b509495945050505050565b60208152600061074d6020830184613013565b60006020828403121561307457600080fd5b81356001600160401b0381111561308a57600080fd5b61130584828501612a90565b600082601f8301126130a757600080fd5b813560206130b482612a6d565b604080516130c28382612a41565b80925084815260208101925060208560061b8801019450878511156130e657600080fd5b602087015b8581101561310a576130fd8982612ce3565b84529284019282016130eb565b50979650505050505050565b60006020828403121561312857600080fd5b81356001600160401b0381111561313e57600080fd5b61130584828501613096565b6020808252825182820181905260009190848201906040850190845b8181101561318b5783516001600160a01b031683529284019291840191600101613166565b50909695505050505050565b600080604083850312156131aa57600080fd5b82356001600160401b03808211156131c157600080fd5b6131cd86838701612df3565b935060208501359150808211156131e357600080fd5b50612de985828601613096565b6000806040838503121561320357600080fd5b50508035926020909101359150565b6000806040838503121561322557600080fd5b61322e8361298d565b9150612f4a6020840161298d565b6000806040838503121561324f57600080fd5b6132588361298d565b9150612f4a60208401612cd3565b60008060006060848603121561327b57600080fd5b6132848461298d565b925060208401356001600160401b03808211156132a057600080fd5b6132ac87838801612b73565b935060408601359150808211156132c257600080fd5b506132cf86828701612e5e565b9150509250925092565b600080606083850312156132ec57600080fd5b82359150612f4a8460208501612ce3565b60008060006060848603121561331257600080fd5b61331b8461298d565b925060208401356001600160401b038082111561333757600080fd5b6132ac87838801612a90565b600080600080600060a0868803121561335b57600080fd5b6133648661298d565b94506133726020870161298d565b9350604086013592506060860135915060808601356001600160401b0381111561339b57600080fd5b612f1a88828901612e5e565b600181811c908216806133bb57607f821691505b6020821081036133db57634e487b7160e01b600052602260045260246000fd5b50919050565b600083516133f3818460208801612c55565b835190830190613407818360208801612c55565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161344e5761344e613426565b5060010190565b634e487b7160e01b600052601260045260246000fd5b60008261347a5761347a613455565b500490565b8181038181111561075057610750613426565b6000826134a1576134a1613455565b500690565b8082018082111561075057610750613426565b601f821115610a02576000816000526020600020601f850160051c810160208610156134e25750805b601f850160051c820191505b818110156114e0578281556001016134ee565b81516001600160401b0381111561351a5761351a612a06565b61352e8161352884546133a7565b846134b9565b602080601f831160018114613563576000841561354b5750858301515b600019600386901b1c1916600185901b1785556114e0565b600085815260208120601f198616915b8281101561359257888601518255948401946001909101908401613573565b50858210156135b05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b815160009082906020808601845b838110156135f55781518051865283015183860152604090940193908201906001016135ce565b50929695505050505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613639816017850160208801612c55565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161366a816028840160208801612c55565b01602801949350505050565b6040815260006136896040830185613013565b828103602084015261369b8185613013565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906136d090830186613013565b82810360608401526136e28186613013565b905082810360808401526136f68185612c79565b98975050505050505050565b60006020828403121561371457600080fd5b815161074d816129d3565b600060033d11156137385760046000803e5060005160e01c5b90565b600060443d10156137495790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561377857505050505090565b82850191508151818111156137905750505050505090565b843d87010160208285010111156137aa5750505050505090565b6137b960208286010187612a41565b509095945050505050565b808202811582820484141761075057610750613426565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061382b90830184612c79565b97965050505050505056fed3889cc5458b268d0544e5534672df1296288ca3f93cbd39bd6f497a5c622811fbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c74392e177520418e6f87f79a16f906a1486466a2682623913688b2e8a8ea3aad156e11ec25828e1d37e7012fb60d670d0c2e6c7b9b5a25209c94dffa2313dc4f156e11ec25828e1d37e7012fb60d670d0c2e6c7b9b5a25209c94dffa2313dc4e1799cf914cb0cb442ca7c7ac709ee40d0cb89e87351dc08d517fbda27d50c68b09acf4e54214992e70883cf7dcd6957ff2c71cd9e14df4bec4383bc0d11607dca264697066735822122026f5cef95ce4370f3537e3d8fa34b140aa96dafa99926b7695db7b6209d5b8ba64736f6c6343000816003300000000000000000000000062286d694f89a1b12c0214bfcd567bb6c29514910000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de100000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x0" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776300000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x1" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15dfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x2" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310400000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x3" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a600000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x4" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15dfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x5" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x223b6", - "value": "0x0", - "data": "0x2f2ff15d832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "nonce": "0x6" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d1776300000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x7" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15dfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x8" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece358310400000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0x9" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a600000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xa" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15dfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xb" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "grantRole(bytes32,address)", - "arguments": [ - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x62286D694F89a1B12c0214bfcD567bb6c2951491" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x1a904", - "value": "0x0", - "data": "0x2f2ff15d832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "nonce": "0xc" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "batchCreateTokens((bool,uint256)[])", - "arguments": [ - "[(false, 100), (true, 100)]" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x29f49", - "value": "0x0", - "data": "0x5c18ca8b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064", - "nonce": "0xd" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "setTokenURI(uint256,string)", - "arguments": [ - "0", - "\"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/0\"" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x27cb0", - "value": "0x0", - "data": "0x162094c4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3000000000000000000000000000000000000000000000000000000000", - "nonce": "0xe" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "setTokenURI(uint256,string)", - "arguments": [ - "1", - "\"ipfs://bafybeiaz55w6kf7ar2g5vzikfbft2qoexknstfouu524l7q3mliutns2u4/1\"" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x27cc1", - "value": "0x0", - "data": "0x162094c4000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3100000000000000000000000000000000000000000000000000000000", - "nonce": "0xf" - }, - "additionalContracts": [], - "isFixedGasLimit": false - }, - { - "hash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionType": "CALL", - "contractName": "ReputationTokensStandalone", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "function": "mint((address,(uint256,uint256)[]))", - "arguments": [ - "(0x62286D694F89a1B12c0214bfcD567bb6c2951491, [(0, 50), (1, 50)])" - ], - "transaction": { - "type": "0x00", - "from": "0x23031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "to": "0x820f78298373ef17675dbc225cef122ac7867358", - "gas": "0x89bfe", - "value": "0x0", - "data": "0x5a449111000000000000000000000000000000000000000000000000000000000000002000000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032", - "nonce": "0x10" - }, - "additionalContracts": [], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionIndex": "0x53", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": null, - "cumulativeGasUsed": "0x11a1572", - "gasUsed": "0x3378f3", - "contractAddress": "0x820f78298373ef17675dbc225cEF122ac7867358", - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionIndex": "0x53", - "logIndex": "0x69", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x07f391e3679732f5c480a4a5d36a92b945710021df33978b73b4f81fc19927e0", - "transactionIndex": "0x53", - "logIndex": "0x6a", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000020000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionIndex": "0x54", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11b8bf3", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xccab643799ec730cd5f23947fc3bcf9639e1816cf604bfb842684f94b9c23aa7", - "transactionIndex": "0x54", - "logIndex": "0x6b", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000080000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000800000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionIndex": "0x55", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11d0274", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x740c01f414eef2388bf87d93c6960f4a32e454b81d285adc330579c0cfa330f0", - "transactionIndex": "0x55", - "logIndex": "0x6c", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionIndex": "0x56", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11e78f5", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xed51907405fcb2281a9c8e2ee9fdfcfcf79bf4612a17fd90f8231165f5cae7b4", - "transactionIndex": "0x56", - "logIndex": "0x6d", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000001000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionIndex": "0x57", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x11fef76", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xe83748eb063f46052ee3bf97c49c8cdd4a4bc4730d4a624633bbc5f709b279b7", - "transactionIndex": "0x57", - "logIndex": "0x6e", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000001000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionIndex": "0x58", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12165f7", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xa4836a43c9802eebfecd15e747ea5aae51e911a22a76f2f55a229c9a48326583", - "transactionIndex": "0x58", - "logIndex": "0x6f", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000004000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionIndex": "0x59", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x122dc78", - "gasUsed": "0x17681", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xf3bff9908b6b70bbe1923d96598b03310169f4532603ede349955195b85c1ca6", - "transactionIndex": "0x59", - "logIndex": "0x70", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00001004000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionIndex": "0x5a", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x124102d", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x60f84e22dcea217c9a7721aaea62b0971fe29d0da3d3c250600e83e005d17763", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xee049f63ec2241422e911820415513bcb5ab716d5c5be7fd75a82cd3be963c95", - "transactionIndex": "0x5a", - "logIndex": "0x71", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000080000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000800000000000000000000000000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionIndex": "0x5b", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12543e2", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfc1552b6aa2747ab03534329d86f6d3131cc2c88af7e48b6486c346619047c1a", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xf17f27a20b9d17c6af6541cd199e3c4951155db09081b0a19469243cecd8972a", - "transactionIndex": "0x5b", - "logIndex": "0x72", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000400000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionIndex": "0x5c", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x1267797", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9d1c74b92ed8239fde331a06b7a12d3e870251719cfdcf1d0885f6ece3583104", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xa0855daeb35b98174d75cb430d123fc7b3602d3c998bbabfaf5ff873f3a76660", - "transactionIndex": "0x5c", - "logIndex": "0x73", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000020000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000201000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionIndex": "0x5d", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x127ab4c", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xcc051663eff190b17681d50c9ef559015ef9b8859419192e44e596e1df4b9566", - "transactionIndex": "0x5d", - "logIndex": "0x74", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000004000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000001000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000001000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionIndex": "0x5e", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x128df01", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x8350ee5423f912b840dd2bc7bb89ab7767fee18791535ce7c5b93787719e23b7", - "transactionIndex": "0x5e", - "logIndex": "0x75", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000004000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionIndex": "0x5f", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12a12b6", - "gasUsed": "0x133b5", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x832b0668f4756f82d274d4d6d2a66f96a8b25b4353ad5dfdae0e691d7769619b", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xa81891fff5e2f9b4c0220025a8a52a2cc1452f8c3defce3cea3f6cf12341317a", - "transactionIndex": "0x5f", - "logIndex": "0x76", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00001004000000200800000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000004000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000000000000000000000100000100000000000000000000000000000000000200000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12bf8b6", - "gasUsed": "0x1e600", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x64295d14d9ee49959a21ba32d5dc243e7e41287ccc6b56899ff62dae58b1951a" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x77", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x78", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x27d80c3568fbf0205db2e99e87305cb23a832ae0d1ac5bedda3b60cc50a4e3ba", - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x84d38288bfc2d0dbffb953282e4834a72a7fd5e9f8000d46139e8490d63b1338" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x79", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x87e3815a48345e68bcb3b841a4854cc3547516ec3ee201afed06197c6008aba9" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0xc204e984fe6084af191ad8ab72ef02cdfbd2adc9452aaf58dcf0ae49a57c657e", - "transactionIndex": "0x60", - "logIndex": "0x7a", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200000000000000000000000000040000000000400000000000080000000000000000000000000000000000000000800000000000000040000008000000000000000000000000000080000000000040000000000000000000000000000020000008000000000000800000000000000000000001000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000010000000000000000000000000020000000000000000000000000000000000001000000000000000000000000000000000000100000060001000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionIndex": "0x61", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12dc5aa", - "gasUsed": "0x1ccf4", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x64c2e549a40d086416dacb483baae24115b5814994ba1e3a10994dfdcd65de42", - "transactionIndex": "0x61", - "logIndex": "0x7b", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000020000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000020000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionIndex": "0x62", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x12f92aa", - "gasUsed": "0x1cd00", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b", - "0x0000000000000000000000000000000000000000000000000000000000000001" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000044697066733a2f2f62616679626569617a353577366b66376172326735767a696b6662667432716f65786b6e7374666f75753532346c3771336d6c6975746e733275342f3100000000000000000000000000000000000000000000000000000000", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x5c2c21e1b24ad27d4cf49b1244b5623221d691fdc4990fd9534e215e26b47285", - "transactionIndex": "0x62", - "logIndex": "0x7c", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000010000000020000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000040000000000000000000000000000000000000000000000000000000000000000000", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - }, - { - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "from": "0x23031eF4d4D0bEd9036E2B8D3fC7cd449C168dE1", - "to": "0x820f78298373ef17675dbc225cEF122ac7867358", - "cumulativeGasUsed": "0x13575ab", - "gasUsed": "0x5e301", - "contractAddress": null, - "logs": [ - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x57e330d54e3668c90601656969884d7b4e3eefb3d3fb674b313c405b1bd33bc8", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x7d", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x7e", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e3", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0xd7ea3f5e1d5a40d6b02cdc7c631ff4612aa6a1709395548cd15565e7640fab5c" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x7f", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x80", - "removed": false - }, - { - "address": "0x820f78298373ef17675dbc225cEF122ac7867358", - "topics": [ - "0x42605de4a2ddc442c26908dbbf11baa08121660866bce0aa43f09796973026e3", - "0x00000000000000000000000023031ef4d4d0bed9036e2b8d3fc7cd449c168de1", - "0x00000000000000000000000062286d694f89a1b12c0214bfcd567bb6c2951491", - "0xd7ea3f5e1d5a40d6b02cdc7c631ff4612aa6a1709395548cd15565e7640fab5c" - ], - "data": "0x", - "blockHash": "0xccbb8fca372d58d014fcba1b92e09cf6acc4b834bd0036a0317fed3c6226f195", - "blockNumber": "0x519005", - "transactionHash": "0x6c0fbcd033e15b08e7521225668b70cf456ea959b90aea22d00a7d81a41f6e16", - "transactionIndex": "0x63", - "logIndex": "0x81", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000200800000000000000000000000000000000000000000000000440000010000000000000000040000000000000000000000000000004002000000000000000001000000000000000000000000000000000000000000000000000000000020000001000000000000800000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001004000000000000000000000000000000000000000008000000000100000020000000000400000040000000000200000000000000000000000000080000000080", - "type": "0x0", - "effectiveGasPrice": "0x4132e35d" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1708665001, - "chain": 11155111, - "multi": false, - "commit": "7423c19" -} \ No newline at end of file diff --git a/packages/foundry/deployments/11155111.json b/packages/foundry/deployments/11155111.json deleted file mode 100644 index 51d245f..0000000 --- a/packages/foundry/deployments/11155111.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "networkName": "Sepolia" -} \ No newline at end of file diff --git a/packages/foundry/foundry.toml b/packages/foundry/foundry.toml index 9d8143f..c15273b 100644 --- a/packages/foundry/foundry.toml +++ b/packages/foundry/foundry.toml @@ -10,17 +10,17 @@ localhost = "http://127.0.0.1:8545" mainnet = "https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_API_KEY}" sepolia = "https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -goerli = "https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}" arbitrum = "https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -arbitrumGoerli = "https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +arbitrumSepolia = "https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -optimismGoerli = "https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_API_KEY}" +optimismSepolia = "https://opt-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" polygon = "https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}" gnosis = "https://rpc.gnosischain.com" chiado = "https://rpc.chiadochain.net" base = "https://mainnet.base.org" baseGoerli = "https://goerli.base.org" +baseSepolia = "https://sepolia.base.org" polygonZkEvm = "https://polygonzkevm-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" polygonZkEvmTestnet = "https://polygonzkevm-testnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" zkSyncTestnet = "https://testnet.era.zksync.dev" @@ -30,6 +30,11 @@ scroll = "https://rpc.scroll.io" [etherscan] polygonMumbai = { key = "${ETHERSCAN_API_KEY}" } -goerli = { key = "${ETHERSCAN_API_KEY}" } +sepolia = { key = "${ETHERSCAN_API_KEY}" } + + +[fmt] +line_length = 80 +multiline_func_header = "params_first" # See more config options https://github.com/foundry-rs/foundry/tree/master/config diff --git a/packages/foundry/lib/forge-std/.github/workflows/ci.yml b/packages/foundry/lib/forge-std/.github/workflows/ci.yml index cb241ae..2d68e91 100644 --- a/packages/foundry/lib/forge-std/.github/workflows/ci.yml +++ b/packages/foundry/lib/forge-std/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly @@ -28,7 +28,6 @@ jobs: if: always() run: | output=$(forge build --skip test) - if echo "$output" | grep -q "Warning"; then echo "$output" exit 1 @@ -38,7 +37,6 @@ jobs: if: always() run: | output=$(forge build --skip test --use solc:0.8.0) - if echo "$output" | grep -q "Warning"; then echo "$output" exit 1 @@ -48,7 +46,6 @@ jobs: if: always() run: | output=$(forge build --skip test --use solc:0.7.6) - if echo "$output" | grep -q "Warning"; then echo "$output" exit 1 @@ -58,7 +55,6 @@ jobs: if: always() run: | output=$(forge build --skip test --use solc:0.7.0) - if echo "$output" | grep -q "Warning"; then echo "$output" exit 1 @@ -68,7 +64,6 @@ jobs: if: always() run: | output=$(forge build --skip test --use solc:0.6.12) - if echo "$output" | grep -q "Warning"; then echo "$output" exit 1 @@ -78,7 +73,6 @@ jobs: if: always() run: | output=$(forge build --skip test --use solc:0.6.2) - if echo "$output" | grep -q "Warning"; then echo "$output" exit 1 @@ -104,10 +98,10 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly @@ -120,10 +114,10 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Foundry - uses: onbjerg/foundry-toolchain@v1 + uses: foundry-rs/foundry-toolchain@v1 with: version: nightly diff --git a/packages/foundry/lib/forge-std/.github/workflows/sync.yml b/packages/foundry/lib/forge-std/.github/workflows/sync.yml index 5a9e9d5..9b170f0 100644 --- a/packages/foundry/lib/forge-std/.github/workflows/sync.yml +++ b/packages/foundry/lib/forge-std/.github/workflows/sync.yml @@ -11,11 +11,13 @@ jobs: if: startsWith(github.event.release.tag_name, 'v1') steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 ref: v1 + # The email is derived from the bots user id, + # found here: https://api.github.com/users/github-actions%5Bbot%5D - name: Configure Git run: | git config user.name github-actions[bot] diff --git a/packages/foundry/lib/forge-std/.gitmodules b/packages/foundry/lib/forge-std/.gitmodules deleted file mode 100644 index e124719..0000000 --- a/packages/foundry/lib/forge-std/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/ds-test"] - path = lib/ds-test - url = https://github.com/dapphub/ds-test diff --git a/packages/foundry/lib/forge-std/README.md b/packages/foundry/lib/forge-std/README.md index 8494a7d..0cb8660 100644 --- a/packages/foundry/lib/forge-std/README.md +++ b/packages/foundry/lib/forge-std/README.md @@ -217,7 +217,7 @@ contract Bar { ### Std Assertions -Expand upon the assertion functions from the `DSTest` library. +Contains various assertions. ### `console.log` diff --git a/packages/foundry/lib/forge-std/foundry.toml b/packages/foundry/lib/forge-std/foundry.toml index f9679ee..2bc66fa 100644 --- a/packages/foundry/lib/forge-std/foundry.toml +++ b/packages/foundry/lib/forge-std/foundry.toml @@ -3,9 +3,9 @@ fs_permissions = [{ access = "read-write", path = "./"}] [rpc_endpoints] # The RPC URLs are modified versions of the default for testing initialization. -mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key. -optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash. -arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash. +mainnet = "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX" # Different API key. +optimism_sepolia = "https://sepolia.optimism.io/" # Adds a trailing slash. +arbitrum_one_sepolia = "https://sepolia-rollup.arbitrum.io/rpc/" # Adds a trailing slash. needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}" [fmt] diff --git a/packages/foundry/lib/forge-std/lib/ds-test/.github/workflows/build.yml b/packages/foundry/lib/forge-std/lib/ds-test/.github/workflows/build.yml deleted file mode 100644 index d2ff97d..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/.github/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "Build" -on: - pull_request: - push: -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - - name: setup dapp binary cache - uses: cachix/cachix-action@v12 - with: - name: dapp - - - name: install dapptools - run: nix profile install github:dapphub/dapptools#dapp --accept-flake-config - - - name: install foundry - uses: foundry-rs/foundry-toolchain@v1 - - - name: test with solc-0.5.17 - run: dapp --use solc-0.5.17 test -v - - - name: test with solc-0.6.11 - run: dapp --use solc-0.6.11 test -v - - - name: test with solc-0.7.6 - run: dapp --use solc-0.7.6 test -v - - - name: test with solc-0.8.18 - run: dapp --use solc-0.8.18 test -v - - - name: Run tests with foundry - run: forge test -vvv - diff --git a/packages/foundry/lib/forge-std/lib/ds-test/.gitignore b/packages/foundry/lib/forge-std/lib/ds-test/.gitignore deleted file mode 100644 index 462a994..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.dapple -/build -/out -/cache/ diff --git a/packages/foundry/lib/forge-std/lib/ds-test/LICENSE b/packages/foundry/lib/forge-std/lib/ds-test/LICENSE deleted file mode 100644 index 94a9ed0..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/packages/foundry/lib/forge-std/lib/ds-test/Makefile b/packages/foundry/lib/forge-std/lib/ds-test/Makefile deleted file mode 100644 index 661dac4..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all:; dapp build - -test: - -dapp --use solc:0.4.23 build - -dapp --use solc:0.4.26 build - -dapp --use solc:0.5.17 build - -dapp --use solc:0.6.12 build - -dapp --use solc:0.7.5 build - -demo: - DAPP_SRC=demo dapp --use solc:0.7.5 build - -hevm dapp-test --verbose 3 - -.PHONY: test demo diff --git a/packages/foundry/lib/forge-std/lib/ds-test/default.nix b/packages/foundry/lib/forge-std/lib/ds-test/default.nix deleted file mode 100644 index cf65419..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ solidityPackage, dappsys }: solidityPackage { - name = "ds-test"; - src = ./src; -} diff --git a/packages/foundry/lib/forge-std/lib/ds-test/demo/demo.sol b/packages/foundry/lib/forge-std/lib/ds-test/demo/demo.sol deleted file mode 100644 index f3bb48e..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/demo/demo.sol +++ /dev/null @@ -1,222 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.5.0; - -import "../src/test.sol"; - -contract DemoTest is DSTest { - function test_this() public pure { - require(true); - } - function test_logs() public { - emit log("-- log(string)"); - emit log("a string"); - - emit log("-- log_named_uint(string, uint)"); - emit log_named_uint("uint", 512); - - emit log("-- log_named_int(string, int)"); - emit log_named_int("int", -512); - - emit log("-- log_named_address(string, address)"); - emit log_named_address("address", address(this)); - - emit log("-- log_named_bytes32(string, bytes32)"); - emit log_named_bytes32("bytes32", "a string"); - - emit log("-- log_named_bytes(string, bytes)"); - emit log_named_bytes("bytes", hex"cafefe"); - - emit log("-- log_named_string(string, string)"); - emit log_named_string("string", "a string"); - - emit log("-- log_named_decimal_uint(string, uint, uint)"); - emit log_named_decimal_uint("decimal uint", 1.0e18, 18); - - emit log("-- log_named_decimal_int(string, int, uint)"); - emit log_named_decimal_int("decimal int", -1.0e18, 18); - } - event log_old_named_uint(bytes32,uint); - function test_old_logs() public { - emit log_old_named_uint("key", 500); - emit log_named_bytes32("bkey", "val"); - } - function test_trace() public view { - this.echo("string 1", "string 2"); - } - function test_multiline() public { - emit log("a multiline\\nstring"); - emit log("a multiline string"); - emit log_bytes("a string"); - emit log_bytes("a multiline\nstring"); - emit log_bytes("a multiline\\nstring"); - emit logs(hex"0000"); - emit log_named_bytes("0x0000", hex"0000"); - emit logs(hex"ff"); - } - function echo(string memory s1, string memory s2) public pure - returns (string memory, string memory) - { - return (s1, s2); - } - - function prove_this(uint x) public { - emit log_named_uint("sym x", x); - assertGt(x + 1, 0); - } - - function test_logn() public { - assembly { - log0(0x01, 0x02) - log1(0x01, 0x02, 0x03) - log2(0x01, 0x02, 0x03, 0x04) - log3(0x01, 0x02, 0x03, 0x04, 0x05) - } - } - - event MyEvent(uint, uint indexed, uint, uint indexed); - function test_events() public { - emit MyEvent(1, 2, 3, 4); - } - - function test_asserts() public { - string memory err = "this test has failed!"; - emit log("## assertTrue(bool)\n"); - assertTrue(false); - emit log("\n"); - assertTrue(false, err); - - emit log("\n## assertEq(address,address)\n"); - assertEq(address(this), msg.sender); - emit log("\n"); - assertEq(address(this), msg.sender, err); - - emit log("\n## assertEq32(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(bytes32,bytes32)\n"); - assertEq32("bytes 1", "bytes 2"); - emit log("\n"); - assertEq32("bytes 1", "bytes 2", err); - - emit log("\n## assertEq(uint,uint)\n"); - assertEq(uint(0), 1); - emit log("\n"); - assertEq(uint(0), 1, err); - - emit log("\n## assertEq(int,int)\n"); - assertEq(-1, -2); - emit log("\n"); - assertEq(-1, -2, err); - - emit log("\n## assertEqDecimal(int,int,uint)\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertEqDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertEqDecimal(uint,uint,uint)\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertEqDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGt(uint,uint)\n"); - assertGt(uint(0), 0); - emit log("\n"); - assertGt(uint(0), 0, err); - - emit log("\n## assertGt(int,int)\n"); - assertGt(-1, -1); - emit log("\n"); - assertGt(-1, -1, err); - - emit log("\n## assertGtDecimal(int,int,uint)\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGtDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGtDecimal(uint,uint,uint)\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGtDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertGe(uint,uint)\n"); - assertGe(uint(0), 1); - emit log("\n"); - assertGe(uint(0), 1, err); - - emit log("\n## assertGe(int,int)\n"); - assertGe(-1, 0); - emit log("\n"); - assertGe(-1, 0, err); - - emit log("\n## assertGeDecimal(int,int,uint)\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18); - emit log("\n"); - assertGeDecimal(-2.0e18, -1.1e18, 18, err); - - emit log("\n## assertGeDecimal(uint,uint,uint)\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18); - emit log("\n"); - assertGeDecimal(uint(1.0e18), 1.1e18, 18, err); - - emit log("\n## assertLt(uint,uint)\n"); - assertLt(uint(0), 0); - emit log("\n"); - assertLt(uint(0), 0, err); - - emit log("\n## assertLt(int,int)\n"); - assertLt(-1, -1); - emit log("\n"); - assertLt(-1, -1, err); - - emit log("\n## assertLtDecimal(int,int,uint)\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLtDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLtDecimal(uint,uint,uint)\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLtDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertLe(uint,uint)\n"); - assertLe(uint(1), 0); - emit log("\n"); - assertLe(uint(1), 0, err); - - emit log("\n## assertLe(int,int)\n"); - assertLe(0, -1); - emit log("\n"); - assertLe(0, -1, err); - - emit log("\n## assertLeDecimal(int,int,uint)\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18); - emit log("\n"); - assertLeDecimal(-1.0e18, -1.1e18, 18, err); - - emit log("\n## assertLeDecimal(uint,uint,uint)\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18); - emit log("\n"); - assertLeDecimal(uint(2.0e18), 1.1e18, 18, err); - - emit log("\n## assertEq(string,string)\n"); - string memory s1 = "string 1"; - string memory s2 = "string 2"; - assertEq(s1, s2); - emit log("\n"); - assertEq(s1, s2, err); - - emit log("\n## assertEq0(bytes,bytes)\n"); - assertEq0(hex"abcdef01", hex"abcdef02"); - emit log("\n"); - assertEq0(hex"abcdef01", hex"abcdef02", err); - } -} - -contract DemoTestWithSetUp { - function setUp() public { - } - function test_pass() public pure { - } -} diff --git a/packages/foundry/lib/forge-std/lib/ds-test/package.json b/packages/foundry/lib/forge-std/lib/ds-test/package.json deleted file mode 100644 index 4802ada..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "ds-test", - "version": "1.0.0", - "description": "Assertions, equality checks and other test helpers ", - "bugs": "https://github.com/dapphub/ds-test/issues", - "license": "GPL-3.0", - "author": "Contributors to ds-test", - "files": [ - "src/*" - ], - "repository": { - "type": "git", - "url": "https://github.com/dapphub/ds-test.git" - } -} diff --git a/packages/foundry/lib/forge-std/lib/ds-test/src/test.sol b/packages/foundry/lib/forge-std/lib/ds-test/src/test.sol deleted file mode 100644 index 2bf3375..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/src/test.sol +++ /dev/null @@ -1,592 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -pragma solidity >=0.5.0; - -contract DSTest { - event log (string); - event logs (bytes); - - event log_address (address); - event log_bytes32 (bytes32); - event log_int (int); - event log_uint (uint); - event log_bytes (bytes); - event log_string (string); - - event log_named_address (string key, address val); - event log_named_bytes32 (string key, bytes32 val); - event log_named_decimal_int (string key, int val, uint decimals); - event log_named_decimal_uint (string key, uint val, uint decimals); - event log_named_int (string key, int val); - event log_named_uint (string key, uint val); - event log_named_bytes (string key, bytes val); - event log_named_string (string key, string val); - - bool public IS_TEST = true; - bool private _failed; - - address constant HEVM_ADDRESS = - address(bytes20(uint160(uint256(keccak256('hevm cheat code'))))); - - modifier mayRevert() { _; } - modifier testopts(string memory) { _; } - - function failed() public returns (bool) { - if (_failed) { - return _failed; - } else { - bool globalFailed = false; - if (hasHEVMContext()) { - (, bytes memory retdata) = HEVM_ADDRESS.call( - abi.encodePacked( - bytes4(keccak256("load(address,bytes32)")), - abi.encode(HEVM_ADDRESS, bytes32("failed")) - ) - ); - globalFailed = abi.decode(retdata, (bool)); - } - return globalFailed; - } - } - - function fail() internal virtual { - if (hasHEVMContext()) { - (bool status, ) = HEVM_ADDRESS.call( - abi.encodePacked( - bytes4(keccak256("store(address,bytes32,bytes32)")), - abi.encode(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x01))) - ) - ); - status; // Silence compiler warnings - } - _failed = true; - } - - function hasHEVMContext() internal view returns (bool) { - uint256 hevmCodeSize = 0; - assembly { - hevmCodeSize := extcodesize(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D) - } - return hevmCodeSize > 0; - } - - modifier logs_gas() { - uint startGas = gasleft(); - _; - uint endGas = gasleft(); - emit log_named_uint("gas", startGas - endGas); - } - - function assertTrue(bool condition) internal { - if (!condition) { - emit log("Error: Assertion Failed"); - fail(); - } - } - - function assertTrue(bool condition, string memory err) internal { - if (!condition) { - emit log_named_string("Error", err); - assertTrue(condition); - } - } - - function assertEq(address a, address b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [address]"); - emit log_named_address(" Left", a); - emit log_named_address(" Right", b); - fail(); - } - } - function assertEq(address a, address b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - - function assertEq(bytes32 a, bytes32 b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [bytes32]"); - emit log_named_bytes32(" Left", a); - emit log_named_bytes32(" Right", b); - fail(); - } - } - function assertEq(bytes32 a, bytes32 b, string memory err) internal { - if (a != b) { - emit log_named_string ("Error", err); - assertEq(a, b); - } - } - function assertEq32(bytes32 a, bytes32 b) internal { - assertEq(a, b); - } - function assertEq32(bytes32 a, bytes32 b, string memory err) internal { - assertEq(a, b, err); - } - - function assertEq(int a, int b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - fail(); - } - } - function assertEq(int a, int b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEq(uint a, uint b) internal { - if (a != b) { - emit log("Error: a == b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - fail(); - } - } - function assertEq(uint a, uint b, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - function assertEqDecimal(int a, int b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - fail(); - } - } - function assertEqDecimal(int a, int b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - function assertEqDecimal(uint a, uint b, uint decimals) internal { - if (a != b) { - emit log("Error: a == b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - fail(); - } - } - function assertEqDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a != b) { - emit log_named_string("Error", err); - assertEqDecimal(a, b, decimals); - } - } - - function assertNotEq(address a, address b) internal { - if (a == b) { - emit log("Error: a != b not satisfied [address]"); - emit log_named_address(" Left", a); - emit log_named_address(" Right", b); - fail(); - } - } - function assertNotEq(address a, address b, string memory err) internal { - if (a == b) { - emit log_named_string ("Error", err); - assertNotEq(a, b); - } - } - - function assertNotEq(bytes32 a, bytes32 b) internal { - if (a == b) { - emit log("Error: a != b not satisfied [bytes32]"); - emit log_named_bytes32(" Left", a); - emit log_named_bytes32(" Right", b); - fail(); - } - } - function assertNotEq(bytes32 a, bytes32 b, string memory err) internal { - if (a == b) { - emit log_named_string ("Error", err); - assertNotEq(a, b); - } - } - function assertNotEq32(bytes32 a, bytes32 b) internal { - assertNotEq(a, b); - } - function assertNotEq32(bytes32 a, bytes32 b, string memory err) internal { - assertNotEq(a, b, err); - } - - function assertNotEq(int a, int b) internal { - if (a == b) { - emit log("Error: a != b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - fail(); - } - } - function assertNotEq(int a, int b, string memory err) internal { - if (a == b) { - emit log_named_string("Error", err); - assertNotEq(a, b); - } - } - function assertNotEq(uint a, uint b) internal { - if (a == b) { - emit log("Error: a != b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - fail(); - } - } - function assertNotEq(uint a, uint b, string memory err) internal { - if (a == b) { - emit log_named_string("Error", err); - assertNotEq(a, b); - } - } - function assertNotEqDecimal(int a, int b, uint decimals) internal { - if (a == b) { - emit log("Error: a != b not satisfied [decimal int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - fail(); - } - } - function assertNotEqDecimal(int a, int b, uint decimals, string memory err) internal { - if (a == b) { - emit log_named_string("Error", err); - assertNotEqDecimal(a, b, decimals); - } - } - function assertNotEqDecimal(uint a, uint b, uint decimals) internal { - if (a == b) { - emit log("Error: a != b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - fail(); - } - } - function assertNotEqDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a == b) { - emit log_named_string("Error", err); - assertNotEqDecimal(a, b, decimals); - } - } - - function assertGt(uint a, uint b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGt(uint a, uint b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGt(int a, int b) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGt(int a, int b, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGt(a, b); - } - } - function assertGtDecimal(int a, int b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - function assertGtDecimal(uint a, uint b, uint decimals) internal { - if (a <= b) { - emit log("Error: a > b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a <= b) { - emit log_named_string("Error", err); - assertGtDecimal(a, b, decimals); - } - } - - function assertGe(uint a, uint b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertGe(uint a, uint b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGe(int a, int b) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertGe(int a, int b, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGe(a, b); - } - } - function assertGeDecimal(int a, int b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - function assertGeDecimal(uint a, uint b, uint decimals) internal { - if (a < b) { - emit log("Error: a >= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertGeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a < b) { - emit log_named_string("Error", err); - assertGeDecimal(a, b, decimals); - } - } - - function assertLt(uint a, uint b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLt(uint a, uint b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLt(int a, int b) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLt(int a, int b, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLt(a, b); - } - } - function assertLtDecimal(int a, int b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(int a, int b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - function assertLtDecimal(uint a, uint b, uint decimals) internal { - if (a >= b) { - emit log("Error: a < b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLtDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a >= b) { - emit log_named_string("Error", err); - assertLtDecimal(a, b, decimals); - } - } - - function assertLe(uint a, uint b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [uint]"); - emit log_named_uint(" Value a", a); - emit log_named_uint(" Value b", b); - fail(); - } - } - function assertLe(uint a, uint b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLe(int a, int b) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [int]"); - emit log_named_int(" Value a", a); - emit log_named_int(" Value b", b); - fail(); - } - } - function assertLe(int a, int b, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLe(a, b); - } - } - function assertLeDecimal(int a, int b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal int]"); - emit log_named_decimal_int(" Value a", a, decimals); - emit log_named_decimal_int(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(int a, int b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLeDecimal(a, b, decimals); - } - } - function assertLeDecimal(uint a, uint b, uint decimals) internal { - if (a > b) { - emit log("Error: a <= b not satisfied [decimal uint]"); - emit log_named_decimal_uint(" Value a", a, decimals); - emit log_named_decimal_uint(" Value b", b, decimals); - fail(); - } - } - function assertLeDecimal(uint a, uint b, uint decimals, string memory err) internal { - if (a > b) { - emit log_named_string("Error", err); - assertLeDecimal(a, b, decimals); - } - } - - function assertEq(string memory a, string memory b) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log("Error: a == b not satisfied [string]"); - emit log_named_string(" Left", a); - emit log_named_string(" Right", b); - fail(); - } - } - function assertEq(string memory a, string memory b, string memory err) internal { - if (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } - } - - function assertNotEq(string memory a, string memory b) internal { - if (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b))) { - emit log("Error: a != b not satisfied [string]"); - emit log_named_string(" Left", a); - emit log_named_string(" Right", b); - fail(); - } - } - function assertNotEq(string memory a, string memory b, string memory err) internal { - if (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b))) { - emit log_named_string("Error", err); - assertNotEq(a, b); - } - } - - function checkEq0(bytes memory a, bytes memory b) internal pure returns (bool ok) { - ok = true; - if (a.length == b.length) { - for (uint i = 0; i < a.length; i++) { - if (a[i] != b[i]) { - ok = false; - } - } - } else { - ok = false; - } - } - function assertEq0(bytes memory a, bytes memory b) internal { - if (!checkEq0(a, b)) { - emit log("Error: a == b not satisfied [bytes]"); - emit log_named_bytes(" Left", a); - emit log_named_bytes(" Right", b); - fail(); - } - } - function assertEq0(bytes memory a, bytes memory b, string memory err) internal { - if (!checkEq0(a, b)) { - emit log_named_string("Error", err); - assertEq0(a, b); - } - } - - function assertNotEq0(bytes memory a, bytes memory b) internal { - if (checkEq0(a, b)) { - emit log("Error: a != b not satisfied [bytes]"); - emit log_named_bytes(" Left", a); - emit log_named_bytes(" Right", b); - fail(); - } - } - function assertNotEq0(bytes memory a, bytes memory b, string memory err) internal { - if (checkEq0(a, b)) { - emit log_named_string("Error", err); - assertNotEq0(a, b); - } - } -} diff --git a/packages/foundry/lib/forge-std/lib/ds-test/src/test.t.sol b/packages/foundry/lib/forge-std/lib/ds-test/src/test.t.sol deleted file mode 100644 index d277a30..0000000 --- a/packages/foundry/lib/forge-std/lib/ds-test/src/test.t.sol +++ /dev/null @@ -1,417 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.5.0; - -import {DSTest} from "./test.sol"; - -contract DemoTest is DSTest { - - // --- assertTrue --- - - function testAssertTrue() public { - assertTrue(true, "msg"); - assertTrue(true); - } - function testFailAssertTrue() public { - assertTrue(false); - } - function testFailAssertTrueWithMsg() public { - assertTrue(false, "msg"); - } - - // --- assertEq (Addr) --- - - function testAssertEqAddr() public { - assertEq(address(0x0), address(0x0), "msg"); - assertEq(address(0x0), address(0x0)); - } - function testFailAssertEqAddr() public { - assertEq(address(0x0), address(0x1)); - } - function testFailAssertEqAddrWithMsg() public { - assertEq(address(0x0), address(0x1), "msg"); - } - - // --- assertEq (Bytes32) --- - - function testAssertEqBytes32() public { - assertEq(bytes32("hi"), bytes32("hi"), "msg"); - assertEq(bytes32("hi"), bytes32("hi")); - } - function testFailAssertEqBytes32() public { - assertEq(bytes32("hi"), bytes32("ho")); - } - function testFailAssertEqBytes32WithMsg() public { - assertEq(bytes32("hi"), bytes32("ho"), "msg"); - } - - // --- assertEq (Int) --- - - function testAssertEqInt() public { - assertEq(-1, -1, "msg"); - assertEq(-1, -1); - } - function testFailAssertEqInt() public { - assertEq(-1, -2); - } - function testFailAssertEqIntWithMsg() public { - assertEq(-1, -2, "msg"); - } - - // --- assertEq (UInt) --- - - function testAssertEqUInt() public { - assertEq(uint(1), uint(1), "msg"); - assertEq(uint(1), uint(1)); - } - function testFailAssertEqUInt() public { - assertEq(uint(1), uint(2)); - } - function testFailAssertEqUIntWithMsg() public { - assertEq(uint(1), uint(2), "msg"); - } - - // --- assertEqDecimal (Int) --- - - function testAssertEqDecimalInt() public { - assertEqDecimal(-1, -1, 18, "msg"); - assertEqDecimal(-1, -1, 18); - } - function testFailAssertEqDecimalInt() public { - assertEqDecimal(-1, -2, 18); - } - function testFailAssertEqDecimalIntWithMsg() public { - assertEqDecimal(-1, -2, 18, "msg"); - } - - // --- assertEqDecimal (UInt) --- - - function testAssertEqDecimalUInt() public { - assertEqDecimal(uint(1), uint(1), 18, "msg"); - assertEqDecimal(uint(1), uint(1), 18); - } - function testFailAssertEqDecimalUInt() public { - assertEqDecimal(uint(1), uint(2), 18); - } - function testFailAssertEqDecimalUIntWithMsg() public { - assertEqDecimal(uint(1), uint(2), 18, "msg"); - } - - // --- assertNotEq (Addr) --- - - function testAssertNotEqAddr() public { - assertNotEq(address(0x0), address(0x1), "msg"); - assertNotEq(address(0x0), address(0x1)); - } - function testFailAssertNotEqAddr() public { - assertNotEq(address(0x0), address(0x0)); - } - function testFailAssertNotEqAddrWithMsg() public { - assertNotEq(address(0x0), address(0x0), "msg"); - } - - // --- assertNotEq (Bytes32) --- - - function testAssertNotEqBytes32() public { - assertNotEq(bytes32("hi"), bytes32("ho"), "msg"); - assertNotEq(bytes32("hi"), bytes32("ho")); - } - function testFailAssertNotEqBytes32() public { - assertNotEq(bytes32("hi"), bytes32("hi")); - } - function testFailAssertNotEqBytes32WithMsg() public { - assertNotEq(bytes32("hi"), bytes32("hi"), "msg"); - } - - // --- assertNotEq (Int) --- - - function testAssertNotEqInt() public { - assertNotEq(-1, -2, "msg"); - assertNotEq(-1, -2); - } - function testFailAssertNotEqInt() public { - assertNotEq(-1, -1); - } - function testFailAssertNotEqIntWithMsg() public { - assertNotEq(-1, -1, "msg"); - } - - // --- assertNotEq (UInt) --- - - function testAssertNotEqUInt() public { - assertNotEq(uint(1), uint(2), "msg"); - assertNotEq(uint(1), uint(2)); - } - function testFailAssertNotEqUInt() public { - assertNotEq(uint(1), uint(1)); - } - function testFailAssertNotEqUIntWithMsg() public { - assertNotEq(uint(1), uint(1), "msg"); - } - - // --- assertNotEqDecimal (Int) --- - - function testAssertNotEqDecimalInt() public { - assertNotEqDecimal(-1, -2, 18, "msg"); - assertNotEqDecimal(-1, -2, 18); - } - function testFailAssertNotEqDecimalInt() public { - assertNotEqDecimal(-1, -1, 18); - } - function testFailAssertNotEqDecimalIntWithMsg() public { - assertNotEqDecimal(-1, -1, 18, "msg"); - } - - // --- assertNotEqDecimal (UInt) --- - - function testAssertNotEqDecimalUInt() public { - assertNotEqDecimal(uint(1), uint(2), 18, "msg"); - assertNotEqDecimal(uint(1), uint(2), 18); - } - function testFailAssertNotEqDecimalUInt() public { - assertNotEqDecimal(uint(1), uint(1), 18); - } - function testFailAssertNotEqDecimalUIntWithMsg() public { - assertNotEqDecimal(uint(1), uint(1), 18, "msg"); - } - - // --- assertGt (UInt) --- - - function testAssertGtUInt() public { - assertGt(uint(2), uint(1), "msg"); - assertGt(uint(3), uint(2)); - } - function testFailAssertGtUInt() public { - assertGt(uint(1), uint(2)); - } - function testFailAssertGtUIntWithMsg() public { - assertGt(uint(1), uint(2), "msg"); - } - - // --- assertGt (Int) --- - - function testAssertGtInt() public { - assertGt(-1, -2, "msg"); - assertGt(-1, -3); - } - function testFailAssertGtInt() public { - assertGt(-2, -1); - } - function testFailAssertGtIntWithMsg() public { - assertGt(-2, -1, "msg"); - } - - // --- assertGtDecimal (UInt) --- - - function testAssertGtDecimalUInt() public { - assertGtDecimal(uint(2), uint(1), 18, "msg"); - assertGtDecimal(uint(3), uint(2), 18); - } - function testFailAssertGtDecimalUInt() public { - assertGtDecimal(uint(1), uint(2), 18); - } - function testFailAssertGtDecimalUIntWithMsg() public { - assertGtDecimal(uint(1), uint(2), 18, "msg"); - } - - // --- assertGtDecimal (Int) --- - - function testAssertGtDecimalInt() public { - assertGtDecimal(-1, -2, 18, "msg"); - assertGtDecimal(-1, -3, 18); - } - function testFailAssertGtDecimalInt() public { - assertGtDecimal(-2, -1, 18); - } - function testFailAssertGtDecimalIntWithMsg() public { - assertGtDecimal(-2, -1, 18, "msg"); - } - - // --- assertGe (UInt) --- - - function testAssertGeUInt() public { - assertGe(uint(2), uint(1), "msg"); - assertGe(uint(2), uint(2)); - } - function testFailAssertGeUInt() public { - assertGe(uint(1), uint(2)); - } - function testFailAssertGeUIntWithMsg() public { - assertGe(uint(1), uint(2), "msg"); - } - - // --- assertGe (Int) --- - - function testAssertGeInt() public { - assertGe(-1, -2, "msg"); - assertGe(-1, -1); - } - function testFailAssertGeInt() public { - assertGe(-2, -1); - } - function testFailAssertGeIntWithMsg() public { - assertGe(-2, -1, "msg"); - } - - // --- assertGeDecimal (UInt) --- - - function testAssertGeDecimalUInt() public { - assertGeDecimal(uint(2), uint(1), 18, "msg"); - assertGeDecimal(uint(2), uint(2), 18); - } - function testFailAssertGeDecimalUInt() public { - assertGeDecimal(uint(1), uint(2), 18); - } - function testFailAssertGeDecimalUIntWithMsg() public { - assertGeDecimal(uint(1), uint(2), 18, "msg"); - } - - // --- assertGeDecimal (Int) --- - - function testAssertGeDecimalInt() public { - assertGeDecimal(-1, -2, 18, "msg"); - assertGeDecimal(-1, -2, 18); - } - function testFailAssertGeDecimalInt() public { - assertGeDecimal(-2, -1, 18); - } - function testFailAssertGeDecimalIntWithMsg() public { - assertGeDecimal(-2, -1, 18, "msg"); - } - - // --- assertLt (UInt) --- - - function testAssertLtUInt() public { - assertLt(uint(1), uint(2), "msg"); - assertLt(uint(1), uint(3)); - } - function testFailAssertLtUInt() public { - assertLt(uint(2), uint(2)); - } - function testFailAssertLtUIntWithMsg() public { - assertLt(uint(3), uint(2), "msg"); - } - - // --- assertLt (Int) --- - - function testAssertLtInt() public { - assertLt(-2, -1, "msg"); - assertLt(-1, 0); - } - function testFailAssertLtInt() public { - assertLt(-1, -2); - } - function testFailAssertLtIntWithMsg() public { - assertLt(-1, -1, "msg"); - } - - // --- assertLtDecimal (UInt) --- - - function testAssertLtDecimalUInt() public { - assertLtDecimal(uint(1), uint(2), 18, "msg"); - assertLtDecimal(uint(2), uint(3), 18); - } - function testFailAssertLtDecimalUInt() public { - assertLtDecimal(uint(1), uint(1), 18); - } - function testFailAssertLtDecimalUIntWithMsg() public { - assertLtDecimal(uint(2), uint(1), 18, "msg"); - } - - // --- assertLtDecimal (Int) --- - - function testAssertLtDecimalInt() public { - assertLtDecimal(-2, -1, 18, "msg"); - assertLtDecimal(-2, -1, 18); - } - function testFailAssertLtDecimalInt() public { - assertLtDecimal(-2, -2, 18); - } - function testFailAssertLtDecimalIntWithMsg() public { - assertLtDecimal(-1, -2, 18, "msg"); - } - - // --- assertLe (UInt) --- - - function testAssertLeUInt() public { - assertLe(uint(1), uint(2), "msg"); - assertLe(uint(1), uint(1)); - } - function testFailAssertLeUInt() public { - assertLe(uint(4), uint(2)); - } - function testFailAssertLeUIntWithMsg() public { - assertLe(uint(3), uint(2), "msg"); - } - - // --- assertLe (Int) --- - - function testAssertLeInt() public { - assertLe(-2, -1, "msg"); - assertLe(-1, -1); - } - function testFailAssertLeInt() public { - assertLe(-1, -2); - } - function testFailAssertLeIntWithMsg() public { - assertLe(-1, -3, "msg"); - } - - // --- assertLeDecimal (UInt) --- - - function testAssertLeDecimalUInt() public { - assertLeDecimal(uint(1), uint(2), 18, "msg"); - assertLeDecimal(uint(2), uint(2), 18); - } - function testFailAssertLeDecimalUInt() public { - assertLeDecimal(uint(1), uint(0), 18); - } - function testFailAssertLeDecimalUIntWithMsg() public { - assertLeDecimal(uint(1), uint(0), 18, "msg"); - } - - // --- assertLeDecimal (Int) --- - - function testAssertLeDecimalInt() public { - assertLeDecimal(-2, -1, 18, "msg"); - assertLeDecimal(-2, -2, 18); - } - function testFailAssertLeDecimalInt() public { - assertLeDecimal(-2, -3, 18); - } - function testFailAssertLeDecimalIntWithMsg() public { - assertLeDecimal(-1, -2, 18, "msg"); - } - - // --- assertNotEq (String) --- - - function testAssertNotEqString() public { - assertNotEq(new string(1), new string(2), "msg"); - assertNotEq(new string(1), new string(2)); - } - function testFailAssertNotEqString() public { - assertNotEq(new string(1), new string(1)); - } - function testFailAssertNotEqStringWithMsg() public { - assertNotEq(new string(1), new string(1), "msg"); - } - - // --- assertNotEq0 (Bytes) --- - - function testAssertNotEq0Bytes() public { - assertNotEq0(bytes("hi"), bytes("ho"), "msg"); - assertNotEq0(bytes("hi"), bytes("ho")); - } - function testFailAssertNotEq0Bytes() public { - assertNotEq0(bytes("hi"), bytes("hi")); - } - function testFailAssertNotEq0BytesWithMsg() public { - assertNotEq0(bytes("hi"), bytes("hi"), "msg"); - } - - // --- fail override --- - - // ensure that fail can be overridden - function fail() internal override { - super.fail(); - } -} diff --git a/packages/foundry/lib/forge-std/package.json b/packages/foundry/lib/forge-std/package.json index acc004b..05f5855 100644 --- a/packages/foundry/lib/forge-std/package.json +++ b/packages/foundry/lib/forge-std/package.json @@ -1,6 +1,6 @@ { "name": "forge-std", - "version": "1.7.6", + "version": "1.8.2", "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", "homepage": "https://book.getfoundry.sh/forge/forge-std", "bugs": "https://github.com/foundry-rs/forge-std/issues", diff --git a/packages/foundry/lib/forge-std/scripts/vm.py b/packages/foundry/lib/forge-std/scripts/vm.py index 3cb8452..f0537db 100755 --- a/packages/foundry/lib/forge-std/scripts/vm.py +++ b/packages/foundry/lib/forge-std/scripts/vm.py @@ -30,7 +30,7 @@ def main(): contract = Cheatcodes.from_json(json_str) ccs = contract.cheatcodes - ccs = list(filter(lambda cc: cc.status != "experimental", ccs)) + ccs = list(filter(lambda cc: cc.status not in ["experimental", "internal"], ccs)) ccs.sort(key=lambda cc: cc.func.id) safe = list(filter(lambda cc: cc.safety == "safe", ccs)) diff --git a/packages/foundry/lib/forge-std/src/StdAssertions.sol b/packages/foundry/lib/forge-std/src/StdAssertions.sol index 2778b3a..857ecd5 100644 --- a/packages/foundry/lib/forge-std/src/StdAssertions.sol +++ b/packages/foundry/lib/forge-std/src/StdAssertions.sol @@ -1,10 +1,31 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.9.0; +pragma experimental ABIEncoderV2; -import {DSTest} from "ds-test/test.sol"; -import {stdMath} from "./StdMath.sol"; +import {Vm} from "./Vm.sol"; + +abstract contract StdAssertions { + Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + + event log(string); + event logs(bytes); + + event log_address(address); + event log_bytes32(bytes32); + event log_int(int256); + event log_uint(uint256); + event log_bytes(bytes); + event log_string(string); + + event log_named_address(string key, address val); + event log_named_bytes32(string key, bytes32 val); + event log_named_decimal_int(string key, int256 val, uint256 decimals); + event log_named_decimal_uint(string key, uint256 val, uint256 decimals); + event log_named_int(string key, int256 val); + event log_named_uint(string key, uint256 val); + event log_named_bytes(string key, bytes val); + event log_named_string(string key, string val); -abstract contract StdAssertions is DSTest { event log_array(uint256[] val); event log_array(int256[] val); event log_array(address[] val); @@ -12,315 +33,587 @@ abstract contract StdAssertions is DSTest { event log_named_array(string key, int256[] val); event log_named_array(string key, address[] val); - function fail(string memory err) internal virtual { - emit log_named_string("Error", err); - fail(); + bool private _failed; + + function failed() public view returns (bool) { + if (_failed) { + return _failed; + } else { + return vm.load(address(vm), bytes32("failed")) != bytes32(0); + } } - function assertFalse(bool data) internal virtual { - assertTrue(!data); + function fail() internal virtual { + vm.store(address(vm), bytes32("failed"), bytes32(uint256(1))); + _failed = true; } - function assertFalse(bool data, string memory err) internal virtual { - assertTrue(!data, err); + function assertTrue(bool data) internal pure virtual { + vm.assertTrue(data); } - function assertEq(bool a, bool b) internal virtual { - if (a != b) { - emit log("Error: a == b not satisfied [bool]"); - emit log_named_string(" Left", a ? "true" : "false"); - emit log_named_string(" Right", b ? "true" : "false"); - fail(); - } + function assertTrue(bool data, string memory err) internal pure virtual { + vm.assertTrue(data, err); } - function assertEq(bool a, bool b, string memory err) internal virtual { - if (a != b) { - emit log_named_string("Error", err); - assertEq(a, b); - } + function assertFalse(bool data) internal pure virtual { + vm.assertFalse(data); } - function assertEq(bytes memory a, bytes memory b) internal virtual { - assertEq0(a, b); + function assertFalse(bool data, string memory err) internal pure virtual { + vm.assertFalse(data, err); } - function assertEq(bytes memory a, bytes memory b, string memory err) internal virtual { - assertEq0(a, b, err); + function assertEq(bool left, bool right) internal pure virtual { + vm.assertEq(left, right); } - function assertEq(uint256[] memory a, uint256[] memory b) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [uint[]]"); - emit log_named_array(" Left", a); - emit log_named_array(" Right", b); - fail(); - } + function assertEq(bool left, bool right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); } - function assertEq(int256[] memory a, int256[] memory b) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [int[]]"); - emit log_named_array(" Left", a); - emit log_named_array(" Right", b); - fail(); - } + function assertEq(uint256 left, uint256 right) internal pure virtual { + vm.assertEq(left, right); } - function assertEq(address[] memory a, address[] memory b) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log("Error: a == b not satisfied [address[]]"); - emit log_named_array(" Left", a); - emit log_named_array(" Right", b); - fail(); - } + function assertEq(uint256 left, uint256 right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); } - function assertEq(uint256[] memory a, uint256[] memory b, string memory err) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } + function assertEqDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual { + vm.assertEqDecimal(left, right, decimals); } - function assertEq(int256[] memory a, int256[] memory b, string memory err) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } + function assertEqDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertEqDecimal(left, right, decimals, err); } - function assertEq(address[] memory a, address[] memory b, string memory err) internal virtual { - if (keccak256(abi.encode(a)) != keccak256(abi.encode(b))) { - emit log_named_string("Error", err); - assertEq(a, b); - } + function assertEq(int256 left, int256 right) internal pure virtual { + vm.assertEq(left, right); } - // Legacy helper - function assertEqUint(uint256 a, uint256 b) internal virtual { - assertEq(uint256(a), uint256(b)); + function assertEq(int256 left, int256 right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEqDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual { + vm.assertEqDecimal(left, right, decimals); } - function assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta) internal virtual { - uint256 delta = stdMath.delta(a, b); + function assertEqDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertEqDecimal(left, right, decimals, err); + } - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - emit log_named_uint(" Max Delta", maxDelta); - emit log_named_uint(" Delta", delta); - fail(); - } + function assertEq(address left, address right) internal pure virtual { + vm.assertEq(left, right); } - function assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, string memory err) internal virtual { - uint256 delta = stdMath.delta(a, b); + function assertEq(address left, address right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbs(a, b, maxDelta); - } + function assertEq(bytes32 left, bytes32 right) internal pure virtual { + vm.assertEq(left, right); } - function assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) internal virtual { - uint256 delta = stdMath.delta(a, b); + function assertEq(bytes32 left, bytes32 right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - emit log_named_decimal_uint(" Max Delta", maxDelta, decimals); - emit log_named_decimal_uint(" Delta", delta, decimals); - fail(); - } + function assertEq32(bytes32 left, bytes32 right) internal pure virtual { + assertEq(left, right); + } + + function assertEq32(bytes32 left, bytes32 right, string memory err) internal pure virtual { + assertEq(left, right, err); + } + + function assertEq(string memory left, string memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(string memory left, string memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(bytes memory left, bytes memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(bytes memory left, bytes memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(bool[] memory left, bool[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(bool[] memory left, bool[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(uint256[] memory left, uint256[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(uint256[] memory left, uint256[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(int256[] memory left, int256[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(int256[] memory left, int256[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(address[] memory left, address[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(address[] memory left, address[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(bytes32[] memory left, bytes32[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(bytes32[] memory left, bytes32[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(string[] memory left, string[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(string[] memory left, string[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + function assertEq(bytes[] memory left, bytes[] memory right) internal pure virtual { + vm.assertEq(left, right); + } + + function assertEq(bytes[] memory left, bytes[] memory right, string memory err) internal pure virtual { + vm.assertEq(left, right, err); + } + + // Legacy helper + function assertEqUint(uint256 left, uint256 right) internal pure virtual { + assertEq(left, right); } - function assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals, string memory err) + function assertNotEq(bool left, bool right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(bool left, bool right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(uint256 left, uint256 right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(uint256 left, uint256 right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual { + vm.assertNotEqDecimal(left, right, decimals); + } + + function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal + pure virtual { - uint256 delta = stdMath.delta(a, b); + vm.assertNotEqDecimal(left, right, decimals, err); + } - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } + function assertNotEq(int256 left, int256 right) internal pure virtual { + vm.assertNotEq(left, right); } - function assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta) internal virtual { - uint256 delta = stdMath.delta(a, b); + function assertNotEq(int256 left, int256 right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - emit log_named_uint(" Max Delta", maxDelta); - emit log_named_uint(" Delta", delta); - fail(); - } + function assertNotEqDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual { + vm.assertNotEqDecimal(left, right, decimals); } - function assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, string memory err) internal virtual { - uint256 delta = stdMath.delta(a, b); + function assertNotEqDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertNotEqDecimal(left, right, decimals, err); + } - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbs(a, b, maxDelta); - } + function assertNotEq(address left, address right) internal pure virtual { + vm.assertNotEq(left, right); } - function assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals) internal virtual { - uint256 delta = stdMath.delta(a, b); + function assertNotEq(address left, address right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } - if (delta > maxDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - emit log_named_decimal_uint(" Max Delta", maxDelta, decimals); - emit log_named_decimal_uint(" Delta", delta, decimals); - fail(); - } + function assertNotEq(bytes32 left, bytes32 right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(bytes32 left, bytes32 right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq32(bytes32 left, bytes32 right) internal pure virtual { + assertNotEq(left, right); + } + + function assertNotEq32(bytes32 left, bytes32 right, string memory err) internal pure virtual { + assertNotEq(left, right, err); + } + + function assertNotEq(string memory left, string memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(string memory left, string memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(bytes memory left, bytes memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(bytes memory left, bytes memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(bool[] memory left, bool[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(bool[] memory left, bool[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(uint256[] memory left, uint256[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(uint256[] memory left, uint256[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(int256[] memory left, int256[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(int256[] memory left, int256[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(address[] memory left, address[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(address[] memory left, address[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(bytes32[] memory left, bytes32[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(bytes32[] memory left, bytes32[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(string[] memory left, string[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(string[] memory left, string[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertNotEq(bytes[] memory left, bytes[] memory right) internal pure virtual { + vm.assertNotEq(left, right); + } + + function assertNotEq(bytes[] memory left, bytes[] memory right, string memory err) internal pure virtual { + vm.assertNotEq(left, right, err); + } + + function assertLt(uint256 left, uint256 right) internal pure virtual { + vm.assertLt(left, right); + } + + function assertLt(uint256 left, uint256 right, string memory err) internal pure virtual { + vm.assertLt(left, right, err); + } + + function assertLtDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual { + vm.assertLtDecimal(left, right, decimals); + } + + function assertLtDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertLtDecimal(left, right, decimals, err); + } + + function assertLt(int256 left, int256 right) internal pure virtual { + vm.assertLt(left, right); + } + + function assertLt(int256 left, int256 right, string memory err) internal pure virtual { + vm.assertLt(left, right, err); + } + + function assertLtDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual { + vm.assertLtDecimal(left, right, decimals); + } + + function assertLtDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertLtDecimal(left, right, decimals, err); + } + + function assertGt(uint256 left, uint256 right) internal pure virtual { + vm.assertGt(left, right); + } + + function assertGt(uint256 left, uint256 right, string memory err) internal pure virtual { + vm.assertGt(left, right, err); + } + + function assertGtDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual { + vm.assertGtDecimal(left, right, decimals); + } + + function assertGtDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertGtDecimal(left, right, decimals, err); + } + + function assertGt(int256 left, int256 right) internal pure virtual { + vm.assertGt(left, right); + } + + function assertGt(int256 left, int256 right, string memory err) internal pure virtual { + vm.assertGt(left, right, err); + } + + function assertGtDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual { + vm.assertGtDecimal(left, right, decimals); + } + + function assertGtDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertGtDecimal(left, right, decimals, err); + } + + function assertLe(uint256 left, uint256 right) internal pure virtual { + vm.assertLe(left, right); + } + + function assertLe(uint256 left, uint256 right, string memory err) internal pure virtual { + vm.assertLe(left, right, err); + } + + function assertLeDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual { + vm.assertLeDecimal(left, right, decimals); + } + + function assertLeDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertLeDecimal(left, right, decimals, err); + } + + function assertLe(int256 left, int256 right) internal pure virtual { + vm.assertLe(left, right); + } + + function assertLe(int256 left, int256 right, string memory err) internal pure virtual { + vm.assertLe(left, right, err); + } + + function assertLeDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual { + vm.assertLeDecimal(left, right, decimals); + } + + function assertLeDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertLeDecimal(left, right, decimals, err); + } + + function assertGe(uint256 left, uint256 right) internal pure virtual { + vm.assertGe(left, right); + } + + function assertGe(uint256 left, uint256 right, string memory err) internal pure virtual { + vm.assertGe(left, right, err); + } + + function assertGeDecimal(uint256 left, uint256 right, uint256 decimals) internal pure virtual { + vm.assertGeDecimal(left, right, decimals); + } + + function assertGeDecimal(uint256 left, uint256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertGeDecimal(left, right, decimals, err); + } + + function assertGe(int256 left, int256 right) internal pure virtual { + vm.assertGe(left, right); + } + + function assertGe(int256 left, int256 right, string memory err) internal pure virtual { + vm.assertGe(left, right, err); + } + + function assertGeDecimal(int256 left, int256 right, uint256 decimals) internal pure virtual { + vm.assertGeDecimal(left, right, decimals); + } + + function assertGeDecimal(int256 left, int256 right, uint256 decimals, string memory err) internal pure virtual { + vm.assertGeDecimal(left, right, decimals, err); + } + + function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta) internal pure virtual { + vm.assertApproxEqAbs(left, right, maxDelta); } - function assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals, string memory err) + function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string memory err) internal + pure virtual { - uint256 delta = stdMath.delta(a, b); + vm.assertApproxEqAbs(left, right, maxDelta, err); + } - if (delta > maxDelta) { - emit log_named_string("Error", err); - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } + function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals) + internal + pure + virtual + { + vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals); } - function assertApproxEqRel( - uint256 a, - uint256 b, - uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100% - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. + function assertApproxEqAbsDecimal( + uint256 left, + uint256 right, + uint256 maxDelta, + uint256 decimals, + string memory err + ) internal pure virtual { + vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals, err); + } - uint256 percentDelta = stdMath.percentDelta(a, b); + function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta) internal pure virtual { + vm.assertApproxEqAbs(left, right, maxDelta); + } - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_uint(" Left", a); - emit log_named_uint(" Right", b); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); - emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); - fail(); - } + function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta, string memory err) internal pure virtual { + vm.assertApproxEqAbs(left, right, maxDelta, err); + } + + function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals) + internal + pure + virtual + { + vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals); + } + + function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals, string memory err) + internal + pure + virtual + { + vm.assertApproxEqAbsDecimal(left, right, maxDelta, decimals, err); + } + + function assertApproxEqRel( + uint256 left, + uint256 right, + uint256 maxPercentDelta // An 18 decimal fixed point number, where 1e18 == 100% + ) internal pure virtual { + vm.assertApproxEqRel(left, right, maxPercentDelta); } function assertApproxEqRel( - uint256 a, - uint256 b, + uint256 left, + uint256 right, uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% string memory err - ) internal virtual { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRel(a, b, maxPercentDelta); - } + ) internal pure virtual { + vm.assertApproxEqRel(left, right, maxPercentDelta, err); } function assertApproxEqRelDecimal( - uint256 a, - uint256 b, + uint256 left, + uint256 right, uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% uint256 decimals - ) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [uint]"); - emit log_named_decimal_uint(" Left", a, decimals); - emit log_named_decimal_uint(" Right", b, decimals); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); - emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); - fail(); - } + ) internal pure virtual { + vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals); } function assertApproxEqRelDecimal( - uint256 a, - uint256 b, + uint256 left, + uint256 right, uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% uint256 decimals, string memory err - ) internal virtual { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } + ) internal pure virtual { + vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals, err); } - function assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); - - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_int(" Left", a); - emit log_named_int(" Right", b); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); - emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); - fail(); - } + function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta) internal pure virtual { + vm.assertApproxEqRel(left, right, maxPercentDelta); } - function assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, string memory err) internal virtual { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. - - uint256 percentDelta = stdMath.percentDelta(a, b); + function assertApproxEqRel( + int256 left, + int256 right, + uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% + string memory err + ) internal pure virtual { + vm.assertApproxEqRel(left, right, maxPercentDelta, err); + } - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRel(a, b, maxPercentDelta); - } + function assertApproxEqRelDecimal( + int256 left, + int256 right, + uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% + uint256 decimals + ) internal pure virtual { + vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals); } - function assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals) internal virtual { - if (b == 0) return assertEq(a, b); // If the left is 0, right must be too. + function assertApproxEqRelDecimal( + int256 left, + int256 right, + uint256 maxPercentDelta, // An 18 decimal fixed point number, where 1e18 == 100% + uint256 decimals, + string memory err + ) internal pure virtual { + vm.assertApproxEqRelDecimal(left, right, maxPercentDelta, decimals, err); + } - uint256 percentDelta = stdMath.percentDelta(a, b); + // Inherited from DSTest, not used but kept for backwards-compatibility + function checkEq0(bytes memory left, bytes memory right) internal pure returns (bool) { + return keccak256(left) == keccak256(right); + } - if (percentDelta > maxPercentDelta) { - emit log("Error: a ~= b not satisfied [int]"); - emit log_named_decimal_int(" Left", a, decimals); - emit log_named_decimal_int(" Right", b, decimals); - emit log_named_decimal_uint(" Max % Delta", maxPercentDelta * 100, 18); - emit log_named_decimal_uint(" % Delta", percentDelta * 100, 18); - fail(); - } + function assertEq0(bytes memory left, bytes memory right) internal pure virtual { + assertEq(left, right); } - function assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals, string memory err) - internal - virtual - { - if (b == 0) return assertEq(a, b, err); // If the left is 0, right must be too. + function assertEq0(bytes memory left, bytes memory right, string memory err) internal pure virtual { + assertEq(left, right, err); + } - uint256 percentDelta = stdMath.percentDelta(a, b); + function assertNotEq0(bytes memory left, bytes memory right) internal pure virtual { + assertNotEq(left, right); + } - if (percentDelta > maxPercentDelta) { - emit log_named_string("Error", err); - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } + function assertNotEq0(bytes memory left, bytes memory right, string memory err) internal pure virtual { + assertNotEq(left, right, err); } function assertEqCall(address target, bytes memory callDataA, bytes memory callDataB) internal virtual { @@ -363,14 +656,14 @@ abstract contract StdAssertions is DSTest { emit log("Error: Calls were not equal"); emit log_named_bytes(" Left call revert data", returnDataA); emit log_named_bytes(" Right call return data", returnDataB); - fail(); + revert("assertion failed"); } if (successA && !successB) { emit log("Error: Calls were not equal"); emit log_named_bytes(" Left call return data", returnDataA); emit log_named_bytes(" Right call revert data", returnDataB); - fail(); + revert("assertion failed"); } } } diff --git a/packages/foundry/lib/forge-std/src/StdChains.sol b/packages/foundry/lib/forge-std/src/StdChains.sol index bdc1c56..5815bd6 100644 --- a/packages/foundry/lib/forge-std/src/StdChains.sol +++ b/packages/foundry/lib/forge-std/src/StdChains.sol @@ -197,24 +197,24 @@ abstract contract StdChains { // If adding an RPC here, make sure to test the default RPC URL in `testRpcs` setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545")); setChainWithDefaultRpcUrl( - "mainnet", ChainData("Mainnet", 1, "https://mainnet.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") - ); - setChainWithDefaultRpcUrl( - "goerli", ChainData("Goerli", 5, "https://goerli.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") + "mainnet", ChainData("Mainnet", 1, "https://eth-mainnet.alchemyapi.io/v2/pwc5rmJhrdoaSEfimoKEmsvOjKSmPDrP") ); setChainWithDefaultRpcUrl( "sepolia", ChainData("Sepolia", 11155111, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") ); + setChainWithDefaultRpcUrl("holesky", ChainData("Holesky", 17000, "https://rpc.holesky.ethpandaops.io")); setChainWithDefaultRpcUrl("optimism", ChainData("Optimism", 10, "https://mainnet.optimism.io")); - setChainWithDefaultRpcUrl("optimism_goerli", ChainData("Optimism Goerli", 420, "https://goerli.optimism.io")); + setChainWithDefaultRpcUrl( + "optimism_sepolia", ChainData("Optimism Sepolia", 11155420, "https://sepolia.optimism.io") + ); setChainWithDefaultRpcUrl("arbitrum_one", ChainData("Arbitrum One", 42161, "https://arb1.arbitrum.io/rpc")); setChainWithDefaultRpcUrl( - "arbitrum_one_goerli", ChainData("Arbitrum One Goerli", 421613, "https://goerli-rollup.arbitrum.io/rpc") + "arbitrum_one_sepolia", ChainData("Arbitrum One Sepolia", 421614, "https://sepolia-rollup.arbitrum.io/rpc") ); setChainWithDefaultRpcUrl("arbitrum_nova", ChainData("Arbitrum Nova", 42170, "https://nova.arbitrum.io/rpc")); setChainWithDefaultRpcUrl("polygon", ChainData("Polygon", 137, "https://polygon-rpc.com")); setChainWithDefaultRpcUrl( - "polygon_mumbai", ChainData("Polygon Mumbai", 80001, "https://rpc-mumbai.maticvigil.com") + "polygon_amoy", ChainData("Polygon Amoy", 80002, "https://rpc-amoy.polygon.technology") ); setChainWithDefaultRpcUrl("avalanche", ChainData("Avalanche", 43114, "https://api.avax.network/ext/bc/C/rpc")); setChainWithDefaultRpcUrl( @@ -233,8 +233,10 @@ abstract contract StdChains { "moonriver", ChainData("Moonriver", 1285, "https://rpc.api.moonriver.moonbeam.network") ); setChainWithDefaultRpcUrl("moonbase", ChainData("Moonbase", 1287, "https://rpc.testnet.moonbeam.network")); - setChainWithDefaultRpcUrl("base_goerli", ChainData("Base Goerli", 84531, "https://goerli.base.org")); + setChainWithDefaultRpcUrl("base_sepolia", ChainData("Base Sepolia", 84532, "https://sepolia.base.org")); setChainWithDefaultRpcUrl("base", ChainData("Base", 8453, "https://mainnet.base.org")); + setChainWithDefaultRpcUrl("fraxtal", ChainData("Fraxtal", 252, "https://rpc.frax.com")); + setChainWithDefaultRpcUrl("fraxtal_testnet", ChainData("Fraxtal Testnet", 2522, "https://rpc.testnet.frax.com")); } // set chain info, with priority to chainAlias' rpc url in foundry.toml diff --git a/packages/foundry/lib/forge-std/src/StdInvariant.sol b/packages/foundry/lib/forge-std/src/StdInvariant.sol index bcd9ac0..7620cbf 100644 --- a/packages/foundry/lib/forge-std/src/StdInvariant.sol +++ b/packages/foundry/lib/forge-std/src/StdInvariant.sol @@ -9,6 +9,11 @@ abstract contract StdInvariant { bytes4[] selectors; } + struct FuzzArtifactSelector { + string artifact; + bytes4[] selectors; + } + struct FuzzInterface { address addr; string[] artifacts; @@ -22,7 +27,8 @@ abstract contract StdInvariant { string[] private _excludedArtifacts; string[] private _targetedArtifacts; - FuzzSelector[] private _targetedArtifactSelectors; + FuzzArtifactSelector[] private _targetedArtifactSelectors; + FuzzSelector[] private _targetedSelectors; FuzzInterface[] private _targetedInterfaces; @@ -46,7 +52,7 @@ abstract contract StdInvariant { _targetedArtifacts.push(newTargetedArtifact_); } - function targetArtifactSelector(FuzzSelector memory newTargetedArtifactSelector_) internal { + function targetArtifactSelector(FuzzArtifactSelector memory newTargetedArtifactSelector_) internal { _targetedArtifactSelectors.push(newTargetedArtifactSelector_); } @@ -85,7 +91,7 @@ abstract contract StdInvariant { targetedArtifacts_ = _targetedArtifacts; } - function targetArtifactSelectors() public view returns (FuzzSelector[] memory targetedArtifactSelectors_) { + function targetArtifactSelectors() public view returns (FuzzArtifactSelector[] memory targetedArtifactSelectors_) { targetedArtifactSelectors_ = _targetedArtifactSelectors; } diff --git a/packages/foundry/lib/forge-std/src/StdJson.sol b/packages/foundry/lib/forge-std/src/StdJson.sol index 42d9bb7..6dbde83 100644 --- a/packages/foundry/lib/forge-std/src/StdJson.sol +++ b/packages/foundry/lib/forge-std/src/StdJson.sol @@ -9,21 +9,17 @@ import {VmSafe} from "./Vm.sol"; // To parse: // ``` // using stdJson for string; -// string memory json = vm.readFile("some_peth"); -// json.parseUint(""); +// string memory json = vm.readFile(""); +// json.readUint(""); // ``` // To write: // ``` // using stdJson for string; -// string memory json = "deploymentArtifact"; -// Contract contract = new Contract(); -// json.serialize("contractAddress", address(contract)); -// json = json.serialize("deploymentTimes", uint(1)); -// // store the stringified JSON to the 'json' variable we have been using as a key -// // as we won't need it any longer -// string memory json2 = "finalArtifact"; -// string memory final = json2.serialize("depArtifact", json); -// final.write(""); +// string memory json = "json"; +// json.serialize("a", uint256(123)); +// string memory semiFinal = json.serialize("b", string("test")); +// string memory finalJson = json.serialize("c", semiFinal); +// finalJson.write(""); // ``` library stdJson { diff --git a/packages/foundry/lib/forge-std/src/StdStorage.sol b/packages/foundry/lib/forge-std/src/StdStorage.sol index e5ded70..ffd668c 100644 --- a/packages/foundry/lib/forge-std/src/StdStorage.sol +++ b/packages/foundry/lib/forge-std/src/StdStorage.sol @@ -3,14 +3,22 @@ pragma solidity >=0.6.2 <0.9.0; import {Vm} from "./Vm.sol"; +struct FindData { + uint256 slot; + uint256 offsetLeft; + uint256 offsetRight; + bool found; +} + struct StdStorage { - mapping(address => mapping(bytes4 => mapping(bytes32 => uint256))) slots; - mapping(address => mapping(bytes4 => mapping(bytes32 => bool))) finds; + mapping(address => mapping(bytes4 => mapping(bytes32 => FindData))) finds; bytes32[] _keys; bytes4 _sig; uint256 _depth; address _target; bytes32 _set; + bool _enable_packed_slots; + bytes _calldata; } library stdStorageSafe { @@ -18,94 +26,146 @@ library stdStorageSafe { event WARNING_UninitedSlot(address who, uint256 slot); Vm private constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); + uint256 constant UINT256_MAX = 115792089237316195423570985008687907853269984665640564039457584007913129639935; function sigs(string memory sigStr) internal pure returns (bytes4) { return bytes4(keccak256(bytes(sigStr))); } + function getCallParams(StdStorage storage self) internal view returns (bytes memory) { + if (self._calldata.length == 0) { + return flatten(self._keys); + } else { + return self._calldata; + } + } + + // Calls target contract with configured parameters + function callTarget(StdStorage storage self) internal view returns (bool, bytes32) { + bytes memory cald = abi.encodePacked(self._sig, getCallParams(self)); + (bool success, bytes memory rdat) = self._target.staticcall(cald); + bytes32 result = bytesToBytes32(rdat, 32 * self._depth); + + return (success, result); + } + + // Tries mutating slot value to determine if the targeted value is stored in it. + // If current value is 0, then we are setting slot value to type(uint256).max + // Otherwise, we set it to 0. That way, return value should always be affected. + function checkSlotMutatesCall(StdStorage storage self, bytes32 slot) internal returns (bool) { + bytes32 prevSlotValue = vm.load(self._target, slot); + (bool success, bytes32 prevReturnValue) = callTarget(self); + + bytes32 testVal = prevReturnValue == bytes32(0) ? bytes32(UINT256_MAX) : bytes32(0); + vm.store(self._target, slot, testVal); + + (, bytes32 newReturnValue) = callTarget(self); + + vm.store(self._target, slot, prevSlotValue); + + return (success && (prevReturnValue != newReturnValue)); + } + + // Tries setting one of the bits in slot to 1 until return value changes. + // Index of resulted bit is an offset packed slot has from left/right side + function findOffset(StdStorage storage self, bytes32 slot, bool left) internal returns (bool, uint256) { + for (uint256 offset = 0; offset < 256; offset++) { + uint256 valueToPut = left ? (1 << (255 - offset)) : (1 << offset); + vm.store(self._target, slot, bytes32(valueToPut)); + + (bool success, bytes32 data) = callTarget(self); + + if (success && (uint256(data) > 0)) { + return (true, offset); + } + } + return (false, 0); + } + + function findOffsets(StdStorage storage self, bytes32 slot) internal returns (bool, uint256, uint256) { + bytes32 prevSlotValue = vm.load(self._target, slot); + + (bool foundLeft, uint256 offsetLeft) = findOffset(self, slot, true); + (bool foundRight, uint256 offsetRight) = findOffset(self, slot, false); + + // `findOffset` may mutate slot value, so we are setting it to initial value + vm.store(self._target, slot, prevSlotValue); + return (foundLeft && foundRight, offsetLeft, offsetRight); + } + + function find(StdStorage storage self) internal returns (FindData storage) { + return find(self, true); + } + /// @notice find an arbitrary storage slot given a function sig, input data, address of the contract and a value to check against // slot complexity: // if flat, will be bytes32(uint256(uint)); // if map, will be keccak256(abi.encode(key, uint(slot))); // if deep map, will be keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot))))); // if map struct, will be bytes32(uint256(keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))))) + structFieldDepth); - function find(StdStorage storage self) internal returns (uint256) { + function find(StdStorage storage self, bool _clear) internal returns (FindData storage) { address who = self._target; bytes4 fsig = self._sig; uint256 field_depth = self._depth; - bytes32[] memory ins = self._keys; + bytes memory params = getCallParams(self); // calldata to test against - if (self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { - return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; + if (self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))].found) { + if (_clear) { + clear(self); + } + return self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))]; } - bytes memory cald = abi.encodePacked(fsig, flatten(ins)); vm.record(); - bytes32 fdat; - { - (, bytes memory rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32 * field_depth); - } - + (, bytes32 callResult) = callTarget(self); (bytes32[] memory reads,) = vm.accesses(address(who)); - if (reads.length == 1) { - bytes32 curr = vm.load(who, reads[0]); - if (curr == bytes32(0)) { - emit WARNING_UninitedSlot(who, uint256(reads[0])); - } - if (fdat != curr) { - require( - false, - "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported." - ); - } - emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[0])); - self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[0]); - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; - } else if (reads.length > 1) { + + if (reads.length == 0) { + revert("stdStorage find(StdStorage): No storage use detected for target."); + } else { for (uint256 i = 0; i < reads.length; i++) { bytes32 prev = vm.load(who, reads[i]); if (prev == bytes32(0)) { emit WARNING_UninitedSlot(who, uint256(reads[i])); } - if (prev != fdat) { + + if (!checkSlotMutatesCall(self, reads[i])) { continue; } - bytes32 new_val = ~prev; - // store - vm.store(who, reads[i], new_val); - bool success; - { - bytes memory rdat; - (success, rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32 * field_depth); + + (uint256 offsetLeft, uint256 offsetRight) = (0, 0); + + if (self._enable_packed_slots) { + bool found; + (found, offsetLeft, offsetRight) = findOffsets(self, reads[i]); + if (!found) { + continue; + } } - if (success && fdat == new_val) { - // we found which of the slots is the actual one - emit SlotFound(who, fsig, keccak256(abi.encodePacked(ins, field_depth)), uint256(reads[i])); - self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = uint256(reads[i]); - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))] = true; - vm.store(who, reads[i], prev); - break; + // Check that value between found offsets is equal to the current call result + uint256 curVal = (uint256(prev) & getMaskByOffsets(offsetLeft, offsetRight)) >> offsetRight; + + if (uint256(callResult) != curVal) { + continue; } - vm.store(who, reads[i], prev); + + emit SlotFound(who, fsig, keccak256(abi.encodePacked(params, field_depth)), uint256(reads[i])); + self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))] = + FindData(uint256(reads[i]), offsetLeft, offsetRight, true); + break; } - } else { - revert("stdStorage find(StdStorage): No storage use detected for target."); } require( - self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))], + self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))].found, "stdStorage find(StdStorage): Slot(s) not found." ); - delete self._target; - delete self._sig; - delete self._keys; - delete self._depth; - - return self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]; + if (_clear) { + clear(self); + } + return self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))]; } function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { @@ -123,6 +183,11 @@ library stdStorageSafe { return self; } + function with_calldata(StdStorage storage self, bytes memory _calldata) internal returns (StdStorage storage) { + self._calldata = _calldata; + return self; + } + function with_key(StdStorage storage self, address who) internal returns (StdStorage storage) { self._keys.push(bytes32(uint256(uint160(who)))); return self; @@ -138,15 +203,22 @@ library stdStorageSafe { return self; } + function enable_packed_slots(StdStorage storage self) internal returns (StdStorage storage) { + self._enable_packed_slots = true; + return self; + } + function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { self._depth = _depth; return self; } function read(StdStorage storage self) private returns (bytes memory) { - address t = self._target; - uint256 s = find(self); - return abi.encode(vm.load(t, bytes32(s))); + FindData storage data = find(self, false); + uint256 mask = getMaskByOffsets(data.offsetLeft, data.offsetRight); + uint256 value = (uint256(vm.load(self._target, bytes32(data.slot))) & mask) >> data.offsetRight; + clear(self); + return abi.encode(value); } function read_bytes32(StdStorage storage self) internal returns (bytes32) { @@ -176,7 +248,7 @@ library stdStorageSafe { address who = self._target; uint256 field_depth = self._depth; vm.startMappingRecording(); - uint256 child = find(self) - field_depth; + uint256 child = find(self, true).slot - field_depth; (bool found, bytes32 key, bytes32 parent_slot) = vm.getMappingKeyAndParentOf(who, bytes32(child)); if (!found) { revert( @@ -190,7 +262,7 @@ library stdStorageSafe { address who = self._target; uint256 field_depth = self._depth; vm.startMappingRecording(); - uint256 child = find(self) - field_depth; + uint256 child = find(self, true).slot - field_depth; bool found; bytes32 root_slot; bytes32 parent_slot; @@ -229,6 +301,34 @@ library stdStorageSafe { return result; } + + function clear(StdStorage storage self) internal { + delete self._target; + delete self._sig; + delete self._keys; + delete self._depth; + delete self._enable_packed_slots; + delete self._calldata; + } + + // Returns mask which contains non-zero bits for values between `offsetLeft` and `offsetRight` + // (slotValue & mask) >> offsetRight will be the value of the given packed variable + function getMaskByOffsets(uint256 offsetLeft, uint256 offsetRight) internal pure returns (uint256 mask) { + // mask = ((1 << (256 - (offsetRight + offsetLeft))) - 1) << offsetRight; + // using assembly because (1 << 256) causes overflow + assembly { + mask := shl(offsetRight, sub(shl(sub(256, add(offsetRight, offsetLeft)), 1), 1)) + } + } + + // Returns slot value with updated packed variable. + function getUpdatedSlotValue(bytes32 curValue, uint256 varValue, uint256 offsetLeft, uint256 offsetRight) + internal + pure + returns (bytes32 newValue) + { + return bytes32((uint256(curValue) & ~getMaskByOffsets(offsetLeft, offsetRight)) | (varValue << offsetRight)); + } } library stdStorage { @@ -239,7 +339,11 @@ library stdStorage { } function find(StdStorage storage self) internal returns (uint256) { - return stdStorageSafe.find(self); + return find(self, true); + } + + function find(StdStorage storage self, bool _clear) internal returns (uint256) { + return stdStorageSafe.find(self, _clear).slot; } function target(StdStorage storage self, address _target) internal returns (StdStorage storage) { @@ -266,10 +370,22 @@ library stdStorage { return stdStorageSafe.with_key(self, key); } + function with_calldata(StdStorage storage self, bytes memory _calldata) internal returns (StdStorage storage) { + return stdStorageSafe.with_calldata(self, _calldata); + } + + function enable_packed_slots(StdStorage storage self) internal returns (StdStorage storage) { + return stdStorageSafe.enable_packed_slots(self); + } + function depth(StdStorage storage self, uint256 _depth) internal returns (StdStorage storage) { return stdStorageSafe.depth(self, _depth); } + function clear(StdStorage storage self) internal { + stdStorageSafe.clear(self); + } + function checked_write(StdStorage storage self, address who) internal { checked_write(self, bytes32(uint256(uint160(who)))); } @@ -295,32 +411,36 @@ library stdStorage { address who = self._target; bytes4 fsig = self._sig; uint256 field_depth = self._depth; - bytes32[] memory ins = self._keys; + bytes memory params = stdStorageSafe.getCallParams(self); - bytes memory cald = abi.encodePacked(fsig, flatten(ins)); - if (!self.finds[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]) { - find(self); + if (!self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))].found) { + find(self, false); } - bytes32 slot = bytes32(self.slots[who][fsig][keccak256(abi.encodePacked(ins, field_depth))]); - - bytes32 fdat; - { - (, bytes memory rdat) = who.staticcall(cald); - fdat = bytesToBytes32(rdat, 32 * field_depth); - } - bytes32 curr = vm.load(who, slot); - - if (fdat != curr) { + FindData storage data = self.finds[who][fsig][keccak256(abi.encodePacked(params, field_depth))]; + if ((data.offsetLeft + data.offsetRight) > 0) { + uint256 maxVal = 2 ** (256 - (data.offsetLeft + data.offsetRight)); require( - false, - "stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported." + uint256(set) < maxVal, + string( + abi.encodePacked( + "stdStorage find(StdStorage): Packed slot. We can't fit value greater than ", + vm.toString(maxVal) + ) + ) ); } - vm.store(who, slot, set); - delete self._target; - delete self._sig; - delete self._keys; - delete self._depth; + bytes32 curVal = vm.load(who, bytes32(data.slot)); + bytes32 valToSet = stdStorageSafe.getUpdatedSlotValue(curVal, uint256(set), data.offsetLeft, data.offsetRight); + + vm.store(who, bytes32(data.slot), valToSet); + + (bool success, bytes32 callResult) = stdStorageSafe.callTarget(self); + + if (!success || callResult != set) { + vm.store(who, bytes32(data.slot), curVal); + revert("stdStorage find(StdStorage): Failed to write value."); + } + clear(self); } function read_bytes32(StdStorage storage self) internal returns (bytes32) { @@ -350,29 +470,4 @@ library stdStorage { function root(StdStorage storage self) internal returns (uint256) { return stdStorageSafe.root(self); } - - // Private function so needs to be copied over - function bytesToBytes32(bytes memory b, uint256 offset) private pure returns (bytes32) { - bytes32 out; - - uint256 max = b.length > 32 ? 32 : b.length; - for (uint256 i = 0; i < max; i++) { - out |= bytes32(b[offset + i] & 0xFF) >> (i * 8); - } - return out; - } - - // Private function so needs to be copied over - function flatten(bytes32[] memory b) private pure returns (bytes memory) { - bytes memory result = new bytes(b.length * 32); - for (uint256 i = 0; i < b.length; i++) { - bytes32 k = b[i]; - /// @solidity memory-safe-assembly - assembly { - mstore(add(result, add(32, mul(32, i))), k) - } - } - - return result; - } } diff --git a/packages/foundry/lib/forge-std/src/StdToml.sol b/packages/foundry/lib/forge-std/src/StdToml.sol new file mode 100644 index 0000000..ef88db6 --- /dev/null +++ b/packages/foundry/lib/forge-std/src/StdToml.sol @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.6.0 <0.9.0; + +pragma experimental ABIEncoderV2; + +import {VmSafe} from "./Vm.sol"; + +// Helpers for parsing and writing TOML files +// To parse: +// ``` +// using stdToml for string; +// string memory toml = vm.readFile(""); +// toml.readUint(""); +// ``` +// To write: +// ``` +// using stdToml for string; +// string memory json = "json"; +// json.serialize("a", uint256(123)); +// string memory semiFinal = json.serialize("b", string("test")); +// string memory finalJson = json.serialize("c", semiFinal); +// finalJson.write(""); +// ``` + +library stdToml { + VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code"))))); + + function parseRaw(string memory toml, string memory key) internal pure returns (bytes memory) { + return vm.parseToml(toml, key); + } + + function readUint(string memory toml, string memory key) internal pure returns (uint256) { + return vm.parseTomlUint(toml, key); + } + + function readUintArray(string memory toml, string memory key) internal pure returns (uint256[] memory) { + return vm.parseTomlUintArray(toml, key); + } + + function readInt(string memory toml, string memory key) internal pure returns (int256) { + return vm.parseTomlInt(toml, key); + } + + function readIntArray(string memory toml, string memory key) internal pure returns (int256[] memory) { + return vm.parseTomlIntArray(toml, key); + } + + function readBytes32(string memory toml, string memory key) internal pure returns (bytes32) { + return vm.parseTomlBytes32(toml, key); + } + + function readBytes32Array(string memory toml, string memory key) internal pure returns (bytes32[] memory) { + return vm.parseTomlBytes32Array(toml, key); + } + + function readString(string memory toml, string memory key) internal pure returns (string memory) { + return vm.parseTomlString(toml, key); + } + + function readStringArray(string memory toml, string memory key) internal pure returns (string[] memory) { + return vm.parseTomlStringArray(toml, key); + } + + function readAddress(string memory toml, string memory key) internal pure returns (address) { + return vm.parseTomlAddress(toml, key); + } + + function readAddressArray(string memory toml, string memory key) internal pure returns (address[] memory) { + return vm.parseTomlAddressArray(toml, key); + } + + function readBool(string memory toml, string memory key) internal pure returns (bool) { + return vm.parseTomlBool(toml, key); + } + + function readBoolArray(string memory toml, string memory key) internal pure returns (bool[] memory) { + return vm.parseTomlBoolArray(toml, key); + } + + function readBytes(string memory toml, string memory key) internal pure returns (bytes memory) { + return vm.parseTomlBytes(toml, key); + } + + function readBytesArray(string memory toml, string memory key) internal pure returns (bytes[] memory) { + return vm.parseTomlBytesArray(toml, key); + } + + function serialize(string memory jsonKey, string memory rootObject) internal returns (string memory) { + return vm.serializeJson(jsonKey, rootObject); + } + + function serialize(string memory jsonKey, string memory key, bool value) internal returns (string memory) { + return vm.serializeBool(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bool[] memory value) + internal + returns (string memory) + { + return vm.serializeBool(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, uint256 value) internal returns (string memory) { + return vm.serializeUint(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, uint256[] memory value) + internal + returns (string memory) + { + return vm.serializeUint(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, int256 value) internal returns (string memory) { + return vm.serializeInt(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, int256[] memory value) + internal + returns (string memory) + { + return vm.serializeInt(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, address value) internal returns (string memory) { + return vm.serializeAddress(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, address[] memory value) + internal + returns (string memory) + { + return vm.serializeAddress(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes32 value) internal returns (string memory) { + return vm.serializeBytes32(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes32[] memory value) + internal + returns (string memory) + { + return vm.serializeBytes32(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes memory value) internal returns (string memory) { + return vm.serializeBytes(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, bytes[] memory value) + internal + returns (string memory) + { + return vm.serializeBytes(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, string memory value) + internal + returns (string memory) + { + return vm.serializeString(jsonKey, key, value); + } + + function serialize(string memory jsonKey, string memory key, string[] memory value) + internal + returns (string memory) + { + return vm.serializeString(jsonKey, key, value); + } + + function write(string memory jsonKey, string memory path) internal { + vm.writeToml(jsonKey, path); + } + + function write(string memory jsonKey, string memory path, string memory valueKey) internal { + vm.writeToml(jsonKey, path, valueKey); + } +} diff --git a/packages/foundry/lib/forge-std/src/StdUtils.sol b/packages/foundry/lib/forge-std/src/StdUtils.sol index 0f61305..5d12043 100644 --- a/packages/foundry/lib/forge-std/src/StdUtils.sol +++ b/packages/foundry/lib/forge-std/src/StdUtils.sol @@ -59,7 +59,7 @@ abstract contract StdUtils { function bound(uint256 x, uint256 min, uint256 max) internal pure virtual returns (uint256 result) { result = _bound(x, min, max); - console2_log_StdUtils("Bound Result", result); + console2_log_StdUtils("Bound result", result); } function _bound(int256 x, int256 min, int256 max) internal pure virtual returns (int256 result) { diff --git a/packages/foundry/lib/forge-std/src/Test.sol b/packages/foundry/lib/forge-std/src/Test.sol index 743c183..5ff60ea 100644 --- a/packages/foundry/lib/forge-std/src/Test.sol +++ b/packages/foundry/lib/forge-std/src/Test.sol @@ -19,15 +19,15 @@ import {stdJson} from "./StdJson.sol"; import {stdMath} from "./StdMath.sol"; import {StdStorage, stdStorage} from "./StdStorage.sol"; import {StdStyle} from "./StdStyle.sol"; +import {stdToml} from "./StdToml.sol"; import {StdUtils} from "./StdUtils.sol"; import {Vm} from "./Vm.sol"; // ๐Ÿ“ฆ BOILERPLATE import {TestBase} from "./Base.sol"; -import {DSTest} from "ds-test/test.sol"; // โญ๏ธ TEST -abstract contract Test is TestBase, DSTest, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils { -// Note: IS_TEST() must return true. -// Note: Must have failure system, https://github.com/dapphub/ds-test/blob/cd98eff28324bfac652e63a239a60632a761790b/src/test.sol#L39-L76. +abstract contract Test is TestBase, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils { + // Note: IS_TEST() must return true. + bool public IS_TEST = true; } diff --git a/packages/foundry/lib/forge-std/src/Vm.sol b/packages/foundry/lib/forge-std/src/Vm.sol index cbb3e4a..6b1f291 100644 --- a/packages/foundry/lib/forge-std/src/Vm.sol +++ b/packages/foundry/lib/forge-std/src/Vm.sol @@ -48,6 +48,28 @@ interface VmSafe { Extcodecopy } + /// Forge execution contexts. + enum ForgeContext { + // Test group execution context (test, coverage or snapshot). + TestGroup, + // `forge test` execution context. + Test, + // `forge coverage` execution context. + Coverage, + // `forge snapshot` execution context. + Snapshot, + // Script group execution context (dry run, broadcast or resume). + ScriptGroup, + // `forge script` execution context. + ScriptDryRun, + // `forge script --broadcast` execution context. + ScriptBroadcast, + // `forge script --resume` execution context. + ScriptResume, + // Unknown `forge` execution context. + Unknown + } + /// An Ethereum log. Returned by `getRecordedLogs`. struct Log { // The topics of the log, including the signature, if any. @@ -187,6 +209,8 @@ interface VmSafe { bool reverted; // An ordered list of storage accesses made during an account access operation. StorageAccess[] storageAccesses; + // Call depth traversed during the recording of state differences + uint64 depth; } /// The storage accessed during an `AccountAccess`. @@ -205,6 +229,20 @@ interface VmSafe { bool reverted; } + /// Gas used. Returned by `lastCallGas`. + struct Gas { + // The gas limit of the call. + uint64 gasLimit; + // The total gas used. + uint64 gasTotalUsed; + // The amount of gas used for memory expansion. + uint64 gasMemoryUsed; + // The amount of gas refunded. + int64 gasRefunded; + // The amount of gas remaining. + uint64 gasRemaining; + } + // ======== Environment ======== /// Gets the environment variable `name` and parses it as `address`. @@ -239,6 +277,9 @@ interface VmSafe { /// Reverts if the variable was not found or could not be parsed. function envBytes(string calldata name, string calldata delim) external view returns (bytes[] memory value); + /// Gets the environment variable `name` and returns true if it exists, else returns false. + function envExists(string calldata name) external view returns (bool result); + /// Gets the environment variable `name` and parses it as `int256`. /// Reverts if the variable was not found or could not be parsed. function envInt(string calldata name) external view returns (int256 value); @@ -354,6 +395,9 @@ interface VmSafe { /// Reverts if the variable was not found or could not be parsed. function envUint(string calldata name, string calldata delim) external view returns (uint256[] memory value); + /// Returns true if `forge` command was executed in given context. + function isContext(ForgeContext context) external view returns (bool result); + /// Sets environment variables. function setEnv(string calldata name, string calldata value) external; @@ -370,6 +414,12 @@ interface VmSafe { external returns (EthGetLogs[] memory logs); + /// Gets the current `block.blobbasefee`. + /// You should use this instead of `block.blobbasefee` if you use `vm.blobBaseFee`, as `block.blobbasefee` is assumed to be constant across a transaction, + /// and as a result will get optimized out by the compiler. + /// See https://github.com/foundry-rs/foundry/issues/6180 + function getBlobBaseFee() external view returns (uint256 blobBaseFee); + /// Gets the current `block.number`. /// You should use this instead of `block.number` if you use `vm.roll`, as `block.number` is assumed to be constant across a transaction, /// and as a result will get optimized out by the compiler. @@ -400,6 +450,9 @@ interface VmSafe { /// Gets all the recorded logs. function getRecordedLogs() external returns (Log[] memory logs); + /// Gets the gas used in the last call. + function lastCallGas() external view returns (Gas memory gas); + /// Loads a storage slot from an address. function load(address target, bytes32 slot) external view returns (bytes32 data); @@ -424,6 +477,17 @@ interface VmSafe { /// Signs `digest` with `privateKey` using the secp256k1 curve. function sign(uint256 privateKey, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s); + /// Signs `digest` with signer provided to script using the secp256k1 curve. + /// If `--sender` is provided, the signer with provided address is used, otherwise, + /// if exactly one signer is provided to the script, that signer is used. + /// Raises error if signer passed through `--sender` does not match any unlocked signers or + /// if `--sender` is not provided and not exactly one signer is passed to the script. + function sign(bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s); + + /// Signs `digest` with signer provided to script using the secp256k1 curve. + /// Raises error if none of the signers passed into the script have provided address. + function sign(address signer, bytes32 digest) external pure returns (uint8 v, bytes32 r, bytes32 s); + /// Starts recording all map SSTOREs for later retrieval. function startMappingRecording() external; @@ -465,10 +529,12 @@ interface VmSafe { /// Given a path, query the file system to get information about a file, directory, etc. function fsMetadata(string calldata path) external view returns (FsMetadata memory metadata); - /// Gets the creation bytecode from an artifact file. Takes in the relative path to the json file. + /// Gets the creation bytecode from an artifact file. Takes in the relative path to the json file or the path to the + /// artifact in the form of :: where and parts are optional. function getCode(string calldata artifactPath) external view returns (bytes memory creationBytecode); - /// Gets the deployed bytecode from an artifact file. Takes in the relative path to the json file. + /// Gets the deployed bytecode from an artifact file. Takes in the relative path to the json file or the path to the + /// artifact in the form of :: where and parts are optional. function getDeployedCode(string calldata artifactPath) external view returns (bytes memory runtimeBytecode); /// Returns true if the path exists on disk and is pointing at a directory, else returns false. @@ -480,6 +546,18 @@ interface VmSafe { /// Get the path of the current project root. function projectRoot() external view returns (string memory path); + /// Prompts the user for a string value in the terminal. + function prompt(string calldata promptText) external returns (string memory input); + + /// Prompts the user for an address in the terminal. + function promptAddress(string calldata promptText) external returns (address); + + /// Prompts the user for a hidden string value in the terminal. + function promptSecret(string calldata promptText) external returns (string memory input); + + /// Prompts the user for uint256 in the terminal. + function promptUint(string calldata promptText) external returns (uint256); + /// Reads the directory at the given path recursively, up to `maxDepth`. /// `maxDepth` defaults to 1, meaning only the direct children of the given directory will be returned. /// Follows symbolic links if `followLinks` is true. @@ -546,9 +624,13 @@ interface VmSafe { // ======== JSON ======== - /// Checks if `key` exists in a JSON object. + /// Checks if `key` exists in a JSON object + /// `keyExists` is being deprecated in favor of `keyExistsJson`. It will be removed in future versions. function keyExists(string calldata json, string calldata key) external view returns (bool); + /// Checks if `key` exists in a JSON object. + function keyExistsJson(string calldata json, string calldata key) external view returns (bool); + /// Parses a string of JSON data at `key` and coerces it to `address`. function parseJsonAddress(string calldata json, string calldata key) external pure returns (address); @@ -670,6 +752,11 @@ interface VmSafe { external returns (string memory json); + /// See `serializeJson`. + function serializeUintToHex(string calldata objectKey, string calldata valueKey, uint256 value) + external + returns (string memory json); + /// See `serializeJson`. function serializeUint(string calldata objectKey, string calldata valueKey, uint256 value) external @@ -689,8 +776,11 @@ interface VmSafe { // ======== Scripting ======== - /// Using the address that calls the test contract, has the next call (at this call depth only) - /// create a transaction that can later be signed and sent onchain. + /// Has the next call (at this call depth only) create transactions that can later be signed and sent onchain. + /// Broadcasting address is determined by checking the following in order: + /// 1. If `--sender` argument was provided, that address is used. + /// 2. If exactly one signer (e.g. private key, hw wallet, keystore) is set when `forge broadcast` is invoked, that signer is used. + /// 3. Otherwise, default foundry sender (1804c8AB1F12E6bbf3894d4083f33e07309d1f38) is used. function broadcast() external; /// Has the next call (at this call depth only) create a transaction with the address provided @@ -701,8 +791,11 @@ interface VmSafe { /// provided as the sender that can later be signed and sent onchain. function broadcast(uint256 privateKey) external; - /// Using the address that calls the test contract, has all subsequent calls - /// (at this call depth only) create transactions that can later be signed and sent onchain. + /// Has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain. + /// Broadcasting address is determined by checking the following in order: + /// 1. If `--sender` argument was provided, that address is used. + /// 2. If exactly one signer (e.g. private key, hw wallet, keystore) is set when `forge broadcast` is invoked, that signer is used. + /// 3. Otherwise, default foundry sender (1804c8AB1F12E6bbf3894d4083f33e07309d1f38) is used. function startBroadcast() external; /// Has all subsequent calls (at this call depth only) create transactions with the address @@ -718,6 +811,11 @@ interface VmSafe { // ======== String ======== + /// Returns the index of the first occurrence of a `key` in an `input` string. + /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `key` is not found. + /// Returns 0 in case of an empty `key`. + function indexOf(string calldata input, string calldata key) external pure returns (uint256); + /// Parses the given `string` into an `address`. function parseAddress(string calldata stringifiedValue) external pure returns (address parsedValue); @@ -736,6 +834,18 @@ interface VmSafe { /// Parses the given `string` into a `uint256`. function parseUint(string calldata stringifiedValue) external pure returns (uint256 parsedValue); + /// Replaces occurrences of `from` in the given `string` with `to`. + function replace(string calldata input, string calldata from, string calldata to) + external + pure + returns (string memory output); + + /// Splits the given `string` into an array of strings divided by the `delimiter`. + function split(string calldata input, string calldata delimiter) external pure returns (string[] memory outputs); + + /// Converts the given `string` value to Lowercase. + function toLowercase(string calldata input) external pure returns (string memory output); + /// Converts the given value to a `string`. function toString(address value) external pure returns (string memory stringifiedValue); @@ -754,8 +864,442 @@ interface VmSafe { /// Converts the given value to a `string`. function toString(int256 value) external pure returns (string memory stringifiedValue); + /// Converts the given `string` value to Uppercase. + function toUppercase(string calldata input) external pure returns (string memory output); + + /// Trims leading and trailing whitespace from the given `string` value. + function trim(string calldata input) external pure returns (string memory output); + // ======== Testing ======== + /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`. + /// Formats values with decimals in failure message. + function assertApproxEqAbsDecimal(uint256 left, uint256 right, uint256 maxDelta, uint256 decimals) external pure; + + /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertApproxEqAbsDecimal( + uint256 left, + uint256 right, + uint256 maxDelta, + uint256 decimals, + string calldata error + ) external pure; + + /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`. + /// Formats values with decimals in failure message. + function assertApproxEqAbsDecimal(int256 left, int256 right, uint256 maxDelta, uint256 decimals) external pure; + + /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertApproxEqAbsDecimal( + int256 left, + int256 right, + uint256 maxDelta, + uint256 decimals, + string calldata error + ) external pure; + + /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`. + function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta) external pure; + + /// Compares two `uint256` values. Expects difference to be less than or equal to `maxDelta`. + /// Includes error message into revert string on failure. + function assertApproxEqAbs(uint256 left, uint256 right, uint256 maxDelta, string calldata error) external pure; + + /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`. + function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta) external pure; + + /// Compares two `int256` values. Expects difference to be less than or equal to `maxDelta`. + /// Includes error message into revert string on failure. + function assertApproxEqAbs(int256 left, int256 right, uint256 maxDelta, string calldata error) external pure; + + /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + /// Formats values with decimals in failure message. + function assertApproxEqRelDecimal(uint256 left, uint256 right, uint256 maxPercentDelta, uint256 decimals) + external + pure; + + /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertApproxEqRelDecimal( + uint256 left, + uint256 right, + uint256 maxPercentDelta, + uint256 decimals, + string calldata error + ) external pure; + + /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + /// Formats values with decimals in failure message. + function assertApproxEqRelDecimal(int256 left, int256 right, uint256 maxPercentDelta, uint256 decimals) + external + pure; + + /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertApproxEqRelDecimal( + int256 left, + int256 right, + uint256 maxPercentDelta, + uint256 decimals, + string calldata error + ) external pure; + + /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + function assertApproxEqRel(uint256 left, uint256 right, uint256 maxPercentDelta) external pure; + + /// Compares two `uint256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + /// Includes error message into revert string on failure. + function assertApproxEqRel(uint256 left, uint256 right, uint256 maxPercentDelta, string calldata error) + external + pure; + + /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta) external pure; + + /// Compares two `int256` values. Expects relative difference in percents to be less than or equal to `maxPercentDelta`. + /// `maxPercentDelta` is an 18 decimal fixed point number, where 1e18 == 100% + /// Includes error message into revert string on failure. + function assertApproxEqRel(int256 left, int256 right, uint256 maxPercentDelta, string calldata error) + external + pure; + + /// Asserts that two `uint256` values are equal, formatting them with decimals in failure message. + function assertEqDecimal(uint256 left, uint256 right, uint256 decimals) external pure; + + /// Asserts that two `uint256` values are equal, formatting them with decimals in failure message. + /// Includes error message into revert string on failure. + function assertEqDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure; + + /// Asserts that two `int256` values are equal, formatting them with decimals in failure message. + function assertEqDecimal(int256 left, int256 right, uint256 decimals) external pure; + + /// Asserts that two `int256` values are equal, formatting them with decimals in failure message. + /// Includes error message into revert string on failure. + function assertEqDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure; + + /// Asserts that two `bool` values are equal. + function assertEq(bool left, bool right) external pure; + + /// Asserts that two `bool` values are equal and includes error message into revert string on failure. + function assertEq(bool left, bool right, string calldata error) external pure; + + /// Asserts that two `string` values are equal. + function assertEq(string calldata left, string calldata right) external pure; + + /// Asserts that two `string` values are equal and includes error message into revert string on failure. + function assertEq(string calldata left, string calldata right, string calldata error) external pure; + + /// Asserts that two `bytes` values are equal. + function assertEq(bytes calldata left, bytes calldata right) external pure; + + /// Asserts that two `bytes` values are equal and includes error message into revert string on failure. + function assertEq(bytes calldata left, bytes calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `bool` values are equal. + function assertEq(bool[] calldata left, bool[] calldata right) external pure; + + /// Asserts that two arrays of `bool` values are equal and includes error message into revert string on failure. + function assertEq(bool[] calldata left, bool[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `uint256 values are equal. + function assertEq(uint256[] calldata left, uint256[] calldata right) external pure; + + /// Asserts that two arrays of `uint256` values are equal and includes error message into revert string on failure. + function assertEq(uint256[] calldata left, uint256[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `int256` values are equal. + function assertEq(int256[] calldata left, int256[] calldata right) external pure; + + /// Asserts that two arrays of `int256` values are equal and includes error message into revert string on failure. + function assertEq(int256[] calldata left, int256[] calldata right, string calldata error) external pure; + + /// Asserts that two `uint256` values are equal. + function assertEq(uint256 left, uint256 right) external pure; + + /// Asserts that two arrays of `address` values are equal. + function assertEq(address[] calldata left, address[] calldata right) external pure; + + /// Asserts that two arrays of `address` values are equal and includes error message into revert string on failure. + function assertEq(address[] calldata left, address[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `bytes32` values are equal. + function assertEq(bytes32[] calldata left, bytes32[] calldata right) external pure; + + /// Asserts that two arrays of `bytes32` values are equal and includes error message into revert string on failure. + function assertEq(bytes32[] calldata left, bytes32[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `string` values are equal. + function assertEq(string[] calldata left, string[] calldata right) external pure; + + /// Asserts that two arrays of `string` values are equal and includes error message into revert string on failure. + function assertEq(string[] calldata left, string[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `bytes` values are equal. + function assertEq(bytes[] calldata left, bytes[] calldata right) external pure; + + /// Asserts that two arrays of `bytes` values are equal and includes error message into revert string on failure. + function assertEq(bytes[] calldata left, bytes[] calldata right, string calldata error) external pure; + + /// Asserts that two `uint256` values are equal and includes error message into revert string on failure. + function assertEq(uint256 left, uint256 right, string calldata error) external pure; + + /// Asserts that two `int256` values are equal. + function assertEq(int256 left, int256 right) external pure; + + /// Asserts that two `int256` values are equal and includes error message into revert string on failure. + function assertEq(int256 left, int256 right, string calldata error) external pure; + + /// Asserts that two `address` values are equal. + function assertEq(address left, address right) external pure; + + /// Asserts that two `address` values are equal and includes error message into revert string on failure. + function assertEq(address left, address right, string calldata error) external pure; + + /// Asserts that two `bytes32` values are equal. + function assertEq(bytes32 left, bytes32 right) external pure; + + /// Asserts that two `bytes32` values are equal and includes error message into revert string on failure. + function assertEq(bytes32 left, bytes32 right, string calldata error) external pure; + + /// Asserts that the given condition is false. + function assertFalse(bool condition) external pure; + + /// Asserts that the given condition is false and includes error message into revert string on failure. + function assertFalse(bool condition, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than or equal to second. + /// Formats values with decimals in failure message. + function assertGeDecimal(uint256 left, uint256 right, uint256 decimals) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than or equal to second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertGeDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be greater than or equal to second. + /// Formats values with decimals in failure message. + function assertGeDecimal(int256 left, int256 right, uint256 decimals) external pure; + + /// Compares two `int256` values. Expects first value to be greater than or equal to second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertGeDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than or equal to second. + function assertGe(uint256 left, uint256 right) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than or equal to second. + /// Includes error message into revert string on failure. + function assertGe(uint256 left, uint256 right, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be greater than or equal to second. + function assertGe(int256 left, int256 right) external pure; + + /// Compares two `int256` values. Expects first value to be greater than or equal to second. + /// Includes error message into revert string on failure. + function assertGe(int256 left, int256 right, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than second. + /// Formats values with decimals in failure message. + function assertGtDecimal(uint256 left, uint256 right, uint256 decimals) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertGtDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be greater than second. + /// Formats values with decimals in failure message. + function assertGtDecimal(int256 left, int256 right, uint256 decimals) external pure; + + /// Compares two `int256` values. Expects first value to be greater than second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertGtDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than second. + function assertGt(uint256 left, uint256 right) external pure; + + /// Compares two `uint256` values. Expects first value to be greater than second. + /// Includes error message into revert string on failure. + function assertGt(uint256 left, uint256 right, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be greater than second. + function assertGt(int256 left, int256 right) external pure; + + /// Compares two `int256` values. Expects first value to be greater than second. + /// Includes error message into revert string on failure. + function assertGt(int256 left, int256 right, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be less than or equal to second. + /// Formats values with decimals in failure message. + function assertLeDecimal(uint256 left, uint256 right, uint256 decimals) external pure; + + /// Compares two `uint256` values. Expects first value to be less than or equal to second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertLeDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be less than or equal to second. + /// Formats values with decimals in failure message. + function assertLeDecimal(int256 left, int256 right, uint256 decimals) external pure; + + /// Compares two `int256` values. Expects first value to be less than or equal to second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertLeDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be less than or equal to second. + function assertLe(uint256 left, uint256 right) external pure; + + /// Compares two `uint256` values. Expects first value to be less than or equal to second. + /// Includes error message into revert string on failure. + function assertLe(uint256 left, uint256 right, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be less than or equal to second. + function assertLe(int256 left, int256 right) external pure; + + /// Compares two `int256` values. Expects first value to be less than or equal to second. + /// Includes error message into revert string on failure. + function assertLe(int256 left, int256 right, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be less than second. + /// Formats values with decimals in failure message. + function assertLtDecimal(uint256 left, uint256 right, uint256 decimals) external pure; + + /// Compares two `uint256` values. Expects first value to be less than second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertLtDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be less than second. + /// Formats values with decimals in failure message. + function assertLtDecimal(int256 left, int256 right, uint256 decimals) external pure; + + /// Compares two `int256` values. Expects first value to be less than second. + /// Formats values with decimals in failure message. Includes error message into revert string on failure. + function assertLtDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure; + + /// Compares two `uint256` values. Expects first value to be less than second. + function assertLt(uint256 left, uint256 right) external pure; + + /// Compares two `uint256` values. Expects first value to be less than second. + /// Includes error message into revert string on failure. + function assertLt(uint256 left, uint256 right, string calldata error) external pure; + + /// Compares two `int256` values. Expects first value to be less than second. + function assertLt(int256 left, int256 right) external pure; + + /// Compares two `int256` values. Expects first value to be less than second. + /// Includes error message into revert string on failure. + function assertLt(int256 left, int256 right, string calldata error) external pure; + + /// Asserts that two `uint256` values are not equal, formatting them with decimals in failure message. + function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals) external pure; + + /// Asserts that two `uint256` values are not equal, formatting them with decimals in failure message. + /// Includes error message into revert string on failure. + function assertNotEqDecimal(uint256 left, uint256 right, uint256 decimals, string calldata error) external pure; + + /// Asserts that two `int256` values are not equal, formatting them with decimals in failure message. + function assertNotEqDecimal(int256 left, int256 right, uint256 decimals) external pure; + + /// Asserts that two `int256` values are not equal, formatting them with decimals in failure message. + /// Includes error message into revert string on failure. + function assertNotEqDecimal(int256 left, int256 right, uint256 decimals, string calldata error) external pure; + + /// Asserts that two `bool` values are not equal. + function assertNotEq(bool left, bool right) external pure; + + /// Asserts that two `bool` values are not equal and includes error message into revert string on failure. + function assertNotEq(bool left, bool right, string calldata error) external pure; + + /// Asserts that two `string` values are not equal. + function assertNotEq(string calldata left, string calldata right) external pure; + + /// Asserts that two `string` values are not equal and includes error message into revert string on failure. + function assertNotEq(string calldata left, string calldata right, string calldata error) external pure; + + /// Asserts that two `bytes` values are not equal. + function assertNotEq(bytes calldata left, bytes calldata right) external pure; + + /// Asserts that two `bytes` values are not equal and includes error message into revert string on failure. + function assertNotEq(bytes calldata left, bytes calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `bool` values are not equal. + function assertNotEq(bool[] calldata left, bool[] calldata right) external pure; + + /// Asserts that two arrays of `bool` values are not equal and includes error message into revert string on failure. + function assertNotEq(bool[] calldata left, bool[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `uint256` values are not equal. + function assertNotEq(uint256[] calldata left, uint256[] calldata right) external pure; + + /// Asserts that two arrays of `uint256` values are not equal and includes error message into revert string on failure. + function assertNotEq(uint256[] calldata left, uint256[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `int256` values are not equal. + function assertNotEq(int256[] calldata left, int256[] calldata right) external pure; + + /// Asserts that two arrays of `int256` values are not equal and includes error message into revert string on failure. + function assertNotEq(int256[] calldata left, int256[] calldata right, string calldata error) external pure; + + /// Asserts that two `uint256` values are not equal. + function assertNotEq(uint256 left, uint256 right) external pure; + + /// Asserts that two arrays of `address` values are not equal. + function assertNotEq(address[] calldata left, address[] calldata right) external pure; + + /// Asserts that two arrays of `address` values are not equal and includes error message into revert string on failure. + function assertNotEq(address[] calldata left, address[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `bytes32` values are not equal. + function assertNotEq(bytes32[] calldata left, bytes32[] calldata right) external pure; + + /// Asserts that two arrays of `bytes32` values are not equal and includes error message into revert string on failure. + function assertNotEq(bytes32[] calldata left, bytes32[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `string` values are not equal. + function assertNotEq(string[] calldata left, string[] calldata right) external pure; + + /// Asserts that two arrays of `string` values are not equal and includes error message into revert string on failure. + function assertNotEq(string[] calldata left, string[] calldata right, string calldata error) external pure; + + /// Asserts that two arrays of `bytes` values are not equal. + function assertNotEq(bytes[] calldata left, bytes[] calldata right) external pure; + + /// Asserts that two arrays of `bytes` values are not equal and includes error message into revert string on failure. + function assertNotEq(bytes[] calldata left, bytes[] calldata right, string calldata error) external pure; + + /// Asserts that two `uint256` values are not equal and includes error message into revert string on failure. + function assertNotEq(uint256 left, uint256 right, string calldata error) external pure; + + /// Asserts that two `int256` values are not equal. + function assertNotEq(int256 left, int256 right) external pure; + + /// Asserts that two `int256` values are not equal and includes error message into revert string on failure. + function assertNotEq(int256 left, int256 right, string calldata error) external pure; + + /// Asserts that two `address` values are not equal. + function assertNotEq(address left, address right) external pure; + + /// Asserts that two `address` values are not equal and includes error message into revert string on failure. + function assertNotEq(address left, address right, string calldata error) external pure; + + /// Asserts that two `bytes32` values are not equal. + function assertNotEq(bytes32 left, bytes32 right) external pure; + + /// Asserts that two `bytes32` values are not equal and includes error message into revert string on failure. + function assertNotEq(bytes32 left, bytes32 right, string calldata error) external pure; + + /// Asserts that the given condition is true. + function assertTrue(bool condition) external pure; + + /// Asserts that the given condition is true and includes error message into revert string on failure. + function assertTrue(bool condition, string calldata error) external pure; + /// If the condition is false, discard this run's fuzz inputs and generate new ones. function assume(bool condition) external pure; @@ -777,6 +1321,75 @@ interface VmSafe { /// Suspends execution of the main thread for `duration` milliseconds. function sleep(uint256 duration) external; + // ======== Toml ======== + + /// Checks if `key` exists in a TOML table. + function keyExistsToml(string calldata toml, string calldata key) external view returns (bool); + + /// Parses a string of TOML data at `key` and coerces it to `address`. + function parseTomlAddress(string calldata toml, string calldata key) external pure returns (address); + + /// Parses a string of TOML data at `key` and coerces it to `address[]`. + function parseTomlAddressArray(string calldata toml, string calldata key) + external + pure + returns (address[] memory); + + /// Parses a string of TOML data at `key` and coerces it to `bool`. + function parseTomlBool(string calldata toml, string calldata key) external pure returns (bool); + + /// Parses a string of TOML data at `key` and coerces it to `bool[]`. + function parseTomlBoolArray(string calldata toml, string calldata key) external pure returns (bool[] memory); + + /// Parses a string of TOML data at `key` and coerces it to `bytes`. + function parseTomlBytes(string calldata toml, string calldata key) external pure returns (bytes memory); + + /// Parses a string of TOML data at `key` and coerces it to `bytes32`. + function parseTomlBytes32(string calldata toml, string calldata key) external pure returns (bytes32); + + /// Parses a string of TOML data at `key` and coerces it to `bytes32[]`. + function parseTomlBytes32Array(string calldata toml, string calldata key) + external + pure + returns (bytes32[] memory); + + /// Parses a string of TOML data at `key` and coerces it to `bytes[]`. + function parseTomlBytesArray(string calldata toml, string calldata key) external pure returns (bytes[] memory); + + /// Parses a string of TOML data at `key` and coerces it to `int256`. + function parseTomlInt(string calldata toml, string calldata key) external pure returns (int256); + + /// Parses a string of TOML data at `key` and coerces it to `int256[]`. + function parseTomlIntArray(string calldata toml, string calldata key) external pure returns (int256[] memory); + + /// Returns an array of all the keys in a TOML table. + function parseTomlKeys(string calldata toml, string calldata key) external pure returns (string[] memory keys); + + /// Parses a string of TOML data at `key` and coerces it to `string`. + function parseTomlString(string calldata toml, string calldata key) external pure returns (string memory); + + /// Parses a string of TOML data at `key` and coerces it to `string[]`. + function parseTomlStringArray(string calldata toml, string calldata key) external pure returns (string[] memory); + + /// Parses a string of TOML data at `key` and coerces it to `uint256`. + function parseTomlUint(string calldata toml, string calldata key) external pure returns (uint256); + + /// Parses a string of TOML data at `key` and coerces it to `uint256[]`. + function parseTomlUintArray(string calldata toml, string calldata key) external pure returns (uint256[] memory); + + /// ABI-encodes a TOML table. + function parseToml(string calldata toml) external pure returns (bytes memory abiEncodedData); + + /// ABI-encodes a TOML table at `key`. + function parseToml(string calldata toml, string calldata key) external pure returns (bytes memory abiEncodedData); + + /// Takes serialized JSON, converts to TOML and write a serialized TOML to a file. + function writeToml(string calldata json, string calldata path) external; + + /// Takes serialized JSON, converts to TOML and write a serialized TOML table to an **existing** TOML file, replacing a value with key = + /// This is useful to replace a specific value of a TOML file, without having to parse the entire thing. + function writeToml(string calldata json, string calldata path, string calldata valueKey) external; + // ======== Utilities ======== /// Compute the address of a contract created with CREATE2 using the given CREATE2 deployer. @@ -825,6 +1438,9 @@ interface VmSafe { pure returns (uint256 privateKey); + /// Returns ENS namehash for provided string. + function ensNamehash(string calldata name) external pure returns (bytes32); + /// Gets the label for the specified address. function getLabel(address account) external view returns (string memory currentLabel); @@ -864,6 +1480,14 @@ interface Vm is VmSafe { /// In forking mode, explicitly grant the given address cheatcode access. function allowCheatcodes(address account) external; + /// Sets `block.blobbasefee` + function blobBaseFee(uint256 newBlobBaseFee) external; + + /// Sets the blobhashes in the transaction. + /// Not available on EVM versions before Cancun. + /// If used on unsupported EVM versions it will revert. + function blobhashes(bytes32[] calldata hashes) external; + /// Sets `block.chainid`. function chainId(uint256 newChainId) external; @@ -919,6 +1543,11 @@ interface Vm is VmSafe { /// Sets `block.basefee`. function fee(uint256 newBasefee) external; + /// Gets the blockhashes from the current transaction. + /// Not available on EVM versions before Cancun. + /// If used on unsupported EVM versions it will revert. + function getBlobhashes() external view returns (bytes32[] memory hashes); + /// Returns true if the account is marked as persistent. function isPersistent(address account) external view returns (bool persistent); @@ -966,6 +1595,11 @@ interface Vm is VmSafe { /// If used on unsupported EVM versions it will revert. function prevrandao(bytes32 newPrevrandao) external; + /// Sets `block.prevrandao`. + /// Not available on EVM versions before Paris. Use `difficulty` instead. + /// If used on unsupported EVM versions it will revert. + function prevrandao(uint256 newPrevrandao) external; + /// Reads the current `msg.sender` and `tx.origin` from state and reports if there is any active caller modification. function readCallers() external returns (CallerMode callerMode, address msgSender, address txOrigin); @@ -1111,4 +1745,7 @@ interface Vm is VmSafe { /// Marks a test as skipped. Must be called at the top of the test. function skip(bool skipTest) external; + + /// Stops all safe memory expectation in the current subcontext. + function stopExpectSafeMemory() external; } diff --git a/packages/foundry/lib/forge-std/src/mocks/MockERC20.sol b/packages/foundry/lib/forge-std/src/mocks/MockERC20.sol index 6b825a0..2a022fa 100644 --- a/packages/foundry/lib/forge-std/src/mocks/MockERC20.sol +++ b/packages/foundry/lib/forge-std/src/mocks/MockERC20.sol @@ -1,36 +1,54 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.9.0; +import {IERC20} from "../interfaces/IERC20.sol"; + /// @notice This is a mock contract of the ERC20 standard for testing purposes only, it SHOULD NOT be used in production. /// @dev Forked from: https://github.com/transmissions11/solmate/blob/0384dbaaa4fcb5715738a9254a7c0a4cb62cf458/src/tokens/ERC20.sol -contract MockERC20 { +contract MockERC20 is IERC20 { /*////////////////////////////////////////////////////////////// - EVENTS + METADATA STORAGE //////////////////////////////////////////////////////////////*/ - event Transfer(address indexed from, address indexed to, uint256 amount); + string internal _name; - event Approval(address indexed owner, address indexed spender, uint256 amount); + string internal _symbol; - /*////////////////////////////////////////////////////////////// - METADATA STORAGE - //////////////////////////////////////////////////////////////*/ + uint8 internal _decimals; - string public name; + function name() external view override returns (string memory) { + return _name; + } - string public symbol; + function symbol() external view override returns (string memory) { + return _symbol; + } - uint8 public decimals; + function decimals() external view override returns (uint8) { + return _decimals; + } /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ - uint256 public totalSupply; + uint256 internal _totalSupply; + + mapping(address => uint256) internal _balanceOf; - mapping(address => uint256) public balanceOf; + mapping(address => mapping(address => uint256)) internal _allowance; + + function totalSupply() external view override returns (uint256) { + return _totalSupply; + } - mapping(address => mapping(address => uint256)) public allowance; + function balanceOf(address owner) external view override returns (uint256) { + return _balanceOf[owner]; + } + + function allowance(address owner, address spender) external view override returns (uint256) { + return _allowance[owner][spender]; + } /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE @@ -51,12 +69,12 @@ contract MockERC20 { /// @dev To hide constructor warnings across solc versions due to different constructor visibility requirements and /// syntaxes, we add an initialization function that can be called only once. - function initialize(string memory _name, string memory _symbol, uint8 _decimals) public { + function initialize(string memory name_, string memory symbol_, uint8 decimals_) public { require(!initialized, "ALREADY_INITIALIZED"); - name = _name; - symbol = _symbol; - decimals = _decimals; + _name = name_; + _symbol = symbol_; + _decimals = decimals_; INITIAL_CHAIN_ID = _pureChainId(); INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); @@ -68,30 +86,30 @@ contract MockERC20 { ERC20 LOGIC //////////////////////////////////////////////////////////////*/ - function approve(address spender, uint256 amount) public virtual returns (bool) { - allowance[msg.sender][spender] = amount; + function approve(address spender, uint256 amount) public virtual override returns (bool) { + _allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } - function transfer(address to, uint256 amount) public virtual returns (bool) { - balanceOf[msg.sender] = _sub(balanceOf[msg.sender], amount); - balanceOf[to] = _add(balanceOf[to], amount); + function transfer(address to, uint256 amount) public virtual override returns (bool) { + _balanceOf[msg.sender] = _sub(_balanceOf[msg.sender], amount); + _balanceOf[to] = _add(_balanceOf[to], amount); emit Transfer(msg.sender, to, amount); return true; } - function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) { - uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. + function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { + uint256 allowed = _allowance[from][msg.sender]; // Saves gas for limited approvals. - if (allowed != ~uint256(0)) allowance[from][msg.sender] = _sub(allowed, amount); + if (allowed != ~uint256(0)) _allowance[from][msg.sender] = _sub(allowed, amount); - balanceOf[from] = _sub(balanceOf[from], amount); - balanceOf[to] = _add(balanceOf[to], amount); + _balanceOf[from] = _sub(_balanceOf[from], amount); + _balanceOf[to] = _add(_balanceOf[to], amount); emit Transfer(from, to, amount); @@ -134,7 +152,7 @@ contract MockERC20 { require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); - allowance[recoveredAddress][spender] = value; + _allowance[recoveredAddress][spender] = value; emit Approval(owner, spender, value); } @@ -147,7 +165,7 @@ contract MockERC20 { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), - keccak256(bytes(name)), + keccak256(bytes(_name)), keccak256("1"), _pureChainId(), address(this) @@ -160,15 +178,15 @@ contract MockERC20 { //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { - totalSupply = _add(totalSupply, amount); - balanceOf[to] = _add(balanceOf[to], amount); + _totalSupply = _add(_totalSupply, amount); + _balanceOf[to] = _add(_balanceOf[to], amount); emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { - balanceOf[from] = _sub(balanceOf[from], amount); - totalSupply = _sub(totalSupply, amount); + _balanceOf[from] = _sub(_balanceOf[from], amount); + _totalSupply = _sub(_totalSupply, amount); emit Transfer(from, address(0), amount); } diff --git a/packages/foundry/lib/forge-std/src/mocks/MockERC721.sol b/packages/foundry/lib/forge-std/src/mocks/MockERC721.sol index 7584087..f21151b 100644 --- a/packages/foundry/lib/forge-std/src/mocks/MockERC721.sol +++ b/packages/foundry/lib/forge-std/src/mocks/MockERC721.sol @@ -1,28 +1,28 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.9.0; +import {IERC721Metadata} from "../interfaces/IERC721.sol"; + /// @notice This is a mock contract of the ERC721 standard for testing purposes only, it SHOULD NOT be used in production. /// @dev Forked from: https://github.com/transmissions11/solmate/blob/0384dbaaa4fcb5715738a9254a7c0a4cb62cf458/src/tokens/ERC721.sol -contract MockERC721 { +contract MockERC721 is IERC721Metadata { /*////////////////////////////////////////////////////////////// - EVENTS + METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ - event Transfer(address indexed from, address indexed to, uint256 indexed id); - - event Approval(address indexed owner, address indexed spender, uint256 indexed id); - - event ApprovalForAll(address indexed owner, address indexed operator, bool approved); + string internal _name; - /*////////////////////////////////////////////////////////////// - METADATA STORAGE/LOGIC - //////////////////////////////////////////////////////////////*/ + string internal _symbol; - string public name; + function name() external view override returns (string memory) { + return _name; + } - string public symbol; + function symbol() external view override returns (string memory) { + return _symbol; + } - function tokenURI(uint256 id) public view virtual returns (string memory) {} + function tokenURI(uint256 id) public view virtual override returns (string memory) {} /*////////////////////////////////////////////////////////////// ERC721 BALANCE/OWNER STORAGE @@ -32,11 +32,11 @@ contract MockERC721 { mapping(address => uint256) internal _balanceOf; - function ownerOf(uint256 id) public view virtual returns (address owner) { + function ownerOf(uint256 id) public view virtual override returns (address owner) { require((owner = _ownerOf[id]) != address(0), "NOT_MINTED"); } - function balanceOf(address owner) public view virtual returns (uint256) { + function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ZERO_ADDRESS"); return _balanceOf[owner]; @@ -46,9 +46,17 @@ contract MockERC721 { ERC721 APPROVAL STORAGE //////////////////////////////////////////////////////////////*/ - mapping(uint256 => address) public getApproved; + mapping(uint256 => address) internal _getApproved; + + mapping(address => mapping(address => bool)) internal _isApprovedForAll; - mapping(address => mapping(address => bool)) public isApprovedForAll; + function getApproved(uint256 id) public view virtual override returns (address) { + return _getApproved[id]; + } + + function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { + return _isApprovedForAll[owner][operator]; + } /*////////////////////////////////////////////////////////////// INITIALIZE @@ -59,11 +67,11 @@ contract MockERC721 { /// @dev To hide constructor warnings across solc versions due to different constructor visibility requirements and /// syntaxes, we add an initialization function that can be called only once. - function initialize(string memory _name, string memory _symbol) public { + function initialize(string memory name_, string memory symbol_) public { require(!initialized, "ALREADY_INITIALIZED"); - name = _name; - symbol = _symbol; + _name = name_; + _symbol = symbol_; initialized = true; } @@ -72,29 +80,30 @@ contract MockERC721 { ERC721 LOGIC //////////////////////////////////////////////////////////////*/ - function approve(address spender, uint256 id) public virtual { + function approve(address spender, uint256 id) public payable virtual override { address owner = _ownerOf[id]; - require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED"); + require(msg.sender == owner || _isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED"); - getApproved[id] = spender; + _getApproved[id] = spender; emit Approval(owner, spender, id); } - function setApprovalForAll(address operator, bool approved) public virtual { - isApprovedForAll[msg.sender][operator] = approved; + function setApprovalForAll(address operator, bool approved) public virtual override { + _isApprovedForAll[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } - function transferFrom(address from, address to, uint256 id) public virtual { + function transferFrom(address from, address to, uint256 id) public payable virtual override { require(from == _ownerOf[id], "WRONG_FROM"); require(to != address(0), "INVALID_RECIPIENT"); require( - msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id], "NOT_AUTHORIZED" + msg.sender == from || _isApprovedForAll[from][msg.sender] || msg.sender == _getApproved[id], + "NOT_AUTHORIZED" ); // Underflow of the sender's balance is impossible because we check for @@ -105,12 +114,12 @@ contract MockERC721 { _ownerOf[id] = to; - delete getApproved[id]; + delete _getApproved[id]; emit Transfer(from, to, id); } - function safeTransferFrom(address from, address to, uint256 id) public virtual { + function safeTransferFrom(address from, address to, uint256 id) public payable virtual override { transferFrom(from, to, id); require( @@ -121,7 +130,12 @@ contract MockERC721 { ); } - function safeTransferFrom(address from, address to, uint256 id, bytes memory data) public virtual { + function safeTransferFrom(address from, address to, uint256 id, bytes memory data) + public + payable + virtual + override + { transferFrom(from, to, id); require( @@ -136,7 +150,7 @@ contract MockERC721 { ERC165 LOGIC //////////////////////////////////////////////////////////////*/ - function supportsInterface(bytes4 interfaceId) public pure virtual returns (bool) { + function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == 0x01ffc9a7 // ERC165 Interface ID for ERC165 || interfaceId == 0x80ac58cd // ERC165 Interface ID for ERC721 || interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata @@ -169,7 +183,7 @@ contract MockERC721 { delete _ownerOf[id]; - delete getApproved[id]; + delete _getApproved[id]; emit Transfer(owner, address(0), id); } diff --git a/packages/foundry/lib/forge-std/test/StdAssertions.t.sol b/packages/foundry/lib/forge-std/test/StdAssertions.t.sol index ae998f1..ea79468 100644 --- a/packages/foundry/lib/forge-std/test/StdAssertions.t.sol +++ b/packages/foundry/lib/forge-std/test/StdAssertions.t.sol @@ -1,13 +1,16 @@ // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; -import "../src/Test.sol"; +import "../src/StdAssertions.sol"; +import {Vm} from "../src/Vm.sol"; -contract StdAssertionsTest is Test { - string constant CUSTOM_ERROR = "guh!"; +interface VmInternal is Vm { + function _expectCheatcodeRevert(bytes memory message) external; +} - bool constant EXPECT_PASS = false; - bool constant EXPECT_FAIL = true; +contract StdAssertionsTest is StdAssertions { + string constant errorMessage = "User provided message"; + uint256 constant maxDecimals = 77; bool constant SHOULD_REVERT = true; bool constant SHOULD_RETURN = false; @@ -15,624 +18,7 @@ contract StdAssertionsTest is Test { bool constant STRICT_REVERT_DATA = true; bool constant NON_STRICT_REVERT_DATA = false; - TestTest t = new TestTest(); - - /*////////////////////////////////////////////////////////////////////////// - FAIL(STRING) - //////////////////////////////////////////////////////////////////////////*/ - - function test_ShouldFail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._fail(CUSTOM_ERROR); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_FALSE - //////////////////////////////////////////////////////////////////////////*/ - - function test_AssertFalse_Pass() external { - t._assertFalse(false, EXPECT_PASS); - } - - function test_AssertFalse_Fail() external { - vm.expectEmit(false, false, false, true); - emit log("Error: Assertion Failed"); - t._assertFalse(true, EXPECT_FAIL); - } - - function test_AssertFalse_Err_Pass() external { - t._assertFalse(false, CUSTOM_ERROR, EXPECT_PASS); - } - - function test_AssertFalse_Err_Fail() external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertFalse(true, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BOOL) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertEq_Bool_Pass(bool a) external { - t._assertEq(a, a, EXPECT_PASS); - } - - function testFuzz_AssertEq_Bool_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bool]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_BoolErr_Pass(bool a) external { - t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertEq_BoolErr_Fail(bool a, bool b) external { - vm.assume(a != b); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(BYTES) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertEq_Bytes_Pass(bytes calldata a) external { - t._assertEq(a, a, EXPECT_PASS); - } - - function testFuzz_AssertEq_Bytes_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [bytes]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_BytesErr_Pass(bytes calldata a) external { - t._assertEq(a, a, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertEq_BytesErr_Fail(bytes calldata a, bytes calldata b) external { - vm.assume(keccak256(a) != keccak256(b)); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(ARRAY) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertEq_UintArr_Pass(uint256 e0, uint256 e1, uint256 e2) public { - uint256[] memory a = new uint256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - uint256[] memory b = new uint256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testFuzz_AssertEq_IntArr_Pass(int256 e0, int256 e1, int256 e2) public { - int256[] memory a = new int256[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - int256[] memory b = new int256[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testFuzz_AssertEq_AddressArr_Pass(address e0, address e1, address e2) public { - address[] memory a = new address[](3); - a[0] = e0; - a[1] = e1; - a[2] = e2; - address[] memory b = new address[](3); - b[0] = e0; - b[1] = e1; - b[2] = e2; - - t._assertEq(a, b, EXPECT_PASS); - } - - function testFuzz_AssertEq_UintArr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_IntArr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_AddressArr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_UintArrErr_FailEl(uint256 e1) public { - vm.assume(e1 != 0); - uint256[] memory a = new uint256[](3); - uint256[] memory b = new uint256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testFuzz_AssertEq_IntArrErr_FailEl(int256 e1) public { - vm.assume(e1 != 0); - int256[] memory a = new int256[](3); - int256[] memory b = new int256[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testFuzz_AssertEq_AddressArrErr_FailEl(address e1) public { - vm.assume(e1 != address(0)); - address[] memory a = new address[](3); - address[] memory b = new address[](3); - b[1] = e1; - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testFuzz_AssertEq_UintArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_IntArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_AddressArr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, EXPECT_FAIL); - } - - function testFuzz_AssertEq_UintArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - uint256[] memory a = new uint256[](lenA); - uint256[] memory b = new uint256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [uint[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testFuzz_AssertEq_IntArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - int256[] memory a = new int256[](lenA); - int256[] memory b = new int256[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [int[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - function testFuzz_AssertEq_AddressArrErr_FailLen(uint256 lenA, uint256 lenB) public { - vm.assume(lenA != lenB); - vm.assume(lenA <= 10000); - vm.assume(lenB <= 10000); - address[] memory a = new address[](lenA); - address[] memory b = new address[](lenB); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - vm.expectEmit(false, false, false, true); - emit log("Error: a == b not satisfied [address[]]"); - t._assertEq(a, b, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function test_AssertEqUint() public { - assertEqUint(uint8(1), uint128(1)); - assertEqUint(uint64(2), uint64(2)); - } - - function testFail_AssertEqUint() public { - assertEqUint(uint64(1), uint96(2)); - assertEqUint(uint160(3), uint160(4)); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqAbs_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbs_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqAbs_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbs_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS_DECIMAL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqAbsDecimal_Uint_Pass(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbsDecimal_Uint_Fail(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqAbsDecimal_UintErr_Pass(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbsDecimal_UintErr_Fail(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqAbs_Int_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbs_Int_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqAbs(a, b, maxDelta, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqAbs_IntErr_Pass(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbs_IntErr_Fail(int256 a, int256 b, uint256 maxDelta) external { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbs(a, b, maxDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_ABS_DECIMAL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqAbsDecimal_Int_Pass(int256 a, int256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbsDecimal_Int_Fail(int256 a, int256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqAbsDecimal_IntErr_Pass(int256 a, int256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) <= maxDelta); - - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqAbsDecimal_IntErr_Fail(int256 a, int256 b, uint256 maxDelta, uint256 decimals) - external - { - vm.assume(stdMath.delta(a, b) > maxDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqAbsDecimal(a, b, maxDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqRel_Uint_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqRel_Uint_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqRel_UintErr_Pass(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqRel_UintErr_Fail(uint256 a, uint256 b, uint256 maxPercentDelta) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL_DECIMAL(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqRelDecimal_Uint_Pass( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - uint256 decimals - ) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqRelDecimal_Uint_Fail( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - uint256 decimals - ) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [uint]"); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqRelDecimal_UintErr_Pass( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - uint256 decimals - ) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqRelDecimal_UintErr_Fail( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - uint256 decimals - ) external { - vm.assume(a < type(uint128).max && b < type(uint128).max && b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertApproxEqRel_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqRel_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqRel(a, b, maxPercentDelta, EXPECT_FAIL); - } - - function testFuzz_AssertApproxEqRel_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AssertApproxEqRel_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta) external { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRel(a, b, maxPercentDelta, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - APPROX_EQ_REL_DECIMAL(INT) - //////////////////////////////////////////////////////////////////////////*/ - - function testAssertApproxEqRelDecimal_Int_Pass(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_PASS); - } - - function testAssertApproxEqRelDecimal_Int_Fail(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log("Error: a ~= b not satisfied [int]"); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, EXPECT_FAIL); - } - - function testAssertApproxEqRelDecimal_IntErr_Pass(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) <= maxPercentDelta); - - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_PASS); - } - - function testAssertApproxEqRelDecimal_IntErr_Fail(int128 a, int128 b, uint128 maxPercentDelta, uint128 decimals) - external - { - vm.assume(b != 0); - vm.assume(stdMath.percentDelta(a, b) > maxPercentDelta); - - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_EQ_CALL - //////////////////////////////////////////////////////////////////////////*/ + VmInternal constant vm = VmInternal(address(uint160(uint256(keccak256("hevm cheat code"))))); function testFuzz_AssertEqCall_Return_Pass( bytes memory callDataA, @@ -643,7 +29,7 @@ contract StdAssertionsTest is Test { address targetA = address(new TestMockCall(returnData, SHOULD_RETURN)); address targetB = address(new TestMockCall(returnData, SHOULD_RETURN)); - t._assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData, EXPECT_PASS); + assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData); } function testFuzz_RevertWhenCalled_AssertEqCall_Return_Fail( @@ -658,9 +44,14 @@ contract StdAssertionsTest is Test { address targetA = address(new TestMockCall(returnDataA, SHOULD_RETURN)); address targetB = address(new TestMockCall(returnDataB, SHOULD_RETURN)); - vm.expectEmit(true, true, true, true); - emit log_named_string("Error", "Call return data does not match"); - t._assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData, EXPECT_FAIL); + vm._expectCheatcodeRevert( + bytes( + string.concat( + "Call return data does not match: ", vm.toString(returnDataA), " != ", vm.toString(returnDataB) + ) + ) + ); + assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData); } function testFuzz_AssertEqCall_Revert_Pass( @@ -672,7 +63,7 @@ contract StdAssertionsTest is Test { address targetA = address(new TestMockCall(revertDataA, SHOULD_REVERT)); address targetB = address(new TestMockCall(revertDataB, SHOULD_REVERT)); - t._assertEqCall(targetA, callDataA, targetB, callDataB, NON_STRICT_REVERT_DATA, EXPECT_PASS); + assertEqCall(targetA, callDataA, targetB, callDataB, NON_STRICT_REVERT_DATA); } function testFuzz_RevertWhenCalled_AssertEqCall_Revert_Fail( @@ -686,9 +77,14 @@ contract StdAssertionsTest is Test { address targetA = address(new TestMockCall(revertDataA, SHOULD_REVERT)); address targetB = address(new TestMockCall(revertDataB, SHOULD_REVERT)); - vm.expectEmit(true, true, true, true); - emit log_named_string("Error", "Call revert data does not match"); - t._assertEqCall(targetA, callDataA, targetB, callDataB, STRICT_REVERT_DATA, EXPECT_FAIL); + vm._expectCheatcodeRevert( + bytes( + string.concat( + "Call revert data does not match: ", vm.toString(revertDataA), " != ", vm.toString(revertDataB) + ) + ) + ); + assertEqCall(targetA, callDataA, targetB, callDataB, STRICT_REVERT_DATA); } function testFuzz_RevertWhenCalled_AssertEqCall_Fail( @@ -701,293 +97,27 @@ contract StdAssertionsTest is Test { address targetA = address(new TestMockCall(returnDataA, SHOULD_RETURN)); address targetB = address(new TestMockCall(returnDataB, SHOULD_REVERT)); - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Left call return data", returnDataA); - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Right call revert data", returnDataB); - t._assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData, EXPECT_FAIL); - - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Left call revert data", returnDataB); - vm.expectEmit(true, true, true, true); - emit log_named_bytes(" Right call return data", returnDataA); - t._assertEqCall(targetB, callDataB, targetA, callDataA, strictRevertData, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_NOT_EQ(BYTES) - //////////////////////////////////////////////////////////////////////////*/ - - function testFuzz_AssertNotEq_Bytes_Pass(bytes32 a, bytes32 b) external { - vm.assume(a != b); - t._assertNotEq(a, b, EXPECT_PASS); - } - - function testFuzz_AssertNotEq_Bytes_Fail(bytes32 a) external { - vm.expectEmit(false, false, false, true); - emit log("Error: a != b not satisfied [bytes32]"); - t._assertNotEq(a, a, EXPECT_FAIL); - } - - function testFuzz_AssertNotEq_BytesErr_Pass(bytes32 a, bytes32 b) external { - vm.assume(a != b); - t._assertNotEq(a, b, CUSTOM_ERROR, EXPECT_PASS); - } - - function testFuzz_AsserNottEq_BytesErr_Fail(bytes32 a) external { - vm.expectEmit(false, false, false, true); - emit log_named_string("Error", CUSTOM_ERROR); - t._assertNotEq(a, a, CUSTOM_ERROR, EXPECT_FAIL); - } - - /*////////////////////////////////////////////////////////////////////////// - ASSERT_NOT_EQ(UINT) - //////////////////////////////////////////////////////////////////////////*/ - - function test_AssertNotEqUint() public { - assertNotEq(uint8(1), uint128(2)); - assertNotEq(uint64(3), uint64(4)); - } - - function testFail_AssertNotEqUint() public { - assertNotEq(uint64(1), uint96(1)); - assertNotEq(uint160(2), uint160(2)); - } -} - -contract TestTest is Test { - modifier expectFailure(bool expectFail) { - bool preState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - _; - bool postState = vm.load(HEVM_ADDRESS, bytes32("failed")) != bytes32(0x00); - - if (preState == true) { - return; - } - - if (expectFail) { - require(postState == true, "expected failure not triggered"); - - // unwind the expected failure - vm.store(HEVM_ADDRESS, bytes32("failed"), bytes32(uint256(0x00))); - } else { - require(postState == false, "unexpected failure was triggered"); - } - } - - function _fail(string memory err) external expectFailure(true) { - fail(err); - } - - function _assertFalse(bool data, bool expectFail) external expectFailure(expectFail) { - assertFalse(data); - } - - function _assertFalse(bool data, string memory err, bool expectFail) external expectFailure(expectFail) { - assertFalse(data, err); - } - - function _assertEq(bool a, bool b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bool a, bool b, string memory err, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b, err); - } - - function _assertEq(bytes memory a, bytes memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(bytes memory a, bytes memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(int256[] memory a, int256[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(address[] memory a, address[] memory b, bool expectFail) external expectFailure(expectFail) { - assertEq(a, b); - } - - function _assertEq(uint256[] memory a, uint256[] memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertEq(int256[] memory a, int256[] memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertEq(address[] memory a, address[] memory b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertEq(a, b, err); - } - - function _assertNotEq(bytes32 a, bytes32 b, bool expectFail) external expectFailure(expectFail) { - assertNotEq32(a, b); - } + vm.expectRevert(bytes("assertion failed")); + this.assertEqCallExternal(targetA, callDataA, targetB, callDataB, strictRevertData); - function _assertNotEq(bytes32 a, bytes32 b, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertNotEq32(a, b, err); + vm.expectRevert(bytes("assertion failed")); + this.assertEqCallExternal(targetB, callDataB, targetA, callDataA, strictRevertData); } - function _assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs(uint256 a, uint256 b, uint256 maxDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqAbsDecimal(uint256 a, uint256 b, uint256 maxDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } - - function _assertApproxEqAbsDecimal( - uint256 a, - uint256 b, - uint256 maxDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals, err); - } - - function _assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta); - } - - function _assertApproxEqAbs(int256 a, int256 b, uint256 maxDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbs(a, b, maxDelta, err); - } - - function _assertApproxEqAbsDecimal(int256 a, int256 b, uint256 maxDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals); - } - - function _assertApproxEqAbsDecimal( - int256 a, - int256 b, - uint256 maxDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqAbsDecimal(a, b, maxDelta, decimals, err); - } - - function _assertApproxEqRel(uint256 a, uint256 b, uint256 maxPercentDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel(uint256 a, uint256 b, uint256 maxPercentDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta, err); - } - - function _assertApproxEqRelDecimal(uint256 a, uint256 b, uint256 maxPercentDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } - - function _assertApproxEqRelDecimal( - uint256 a, - uint256 b, - uint256 maxPercentDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, err); - } - - function _assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta); - } - - function _assertApproxEqRel(int256 a, int256 b, uint256 maxPercentDelta, string memory err, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRel(a, b, maxPercentDelta, err); - } - - function _assertApproxEqRelDecimal(int256 a, int256 b, uint256 maxPercentDelta, uint256 decimals, bool expectFail) - external - expectFailure(expectFail) - { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals); - } - - function _assertApproxEqRelDecimal( - int256 a, - int256 b, - uint256 maxPercentDelta, - uint256 decimals, - string memory err, - bool expectFail - ) external expectFailure(expectFail) { - assertApproxEqRelDecimal(a, b, maxPercentDelta, decimals, err); - } - - function _assertEqCall( + // Helper function to test outcome of assertEqCall via `expect` cheatcodes + function assertEqCallExternal( address targetA, bytes memory callDataA, address targetB, bytes memory callDataB, - bool strictRevertData, - bool expectFail - ) external expectFailure(expectFail) { + bool strictRevertData + ) public { assertEqCall(targetA, callDataA, targetB, callDataB, strictRevertData); } + + function testFailFail() public { + fail(); + } } contract TestMockCall { diff --git a/packages/foundry/lib/forge-std/test/StdChains.t.sol b/packages/foundry/lib/forge-std/test/StdChains.t.sol index b329125..f1ee354 100644 --- a/packages/foundry/lib/forge-std/test/StdChains.t.sol +++ b/packages/foundry/lib/forge-std/test/StdChains.t.sol @@ -24,9 +24,9 @@ contract StdChainsMock is Test { contract StdChainsTest is Test { function test_ChainRpcInitialization() public { // RPCs specified in `foundry.toml` should be updated. - assertEq(getChain(1).rpcUrl, "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3"); - assertEq(getChain("optimism_goerli").rpcUrl, "https://goerli.optimism.io/"); - assertEq(getChain("arbitrum_one_goerli").rpcUrl, "https://goerli-rollup.arbitrum.io/rpc/"); + assertEq(getChain(1).rpcUrl, "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX"); + assertEq(getChain("optimism_sepolia").rpcUrl, "https://sepolia.optimism.io/"); + assertEq(getChain("arbitrum_one_sepolia").rpcUrl, "https://sepolia-rollup.arbitrum.io/rpc/"); // Environment variables should be the next fallback assertEq(getChain("arbitrum_nova").rpcUrl, "https://nova.arbitrum.io/rpc"); @@ -36,40 +36,45 @@ contract StdChainsTest is Test { // Cannot override RPCs defined in `foundry.toml` vm.setEnv("MAINNET_RPC_URL", "myoverride2"); - assertEq(getChain("mainnet").rpcUrl, "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3"); + assertEq(getChain("mainnet").rpcUrl, "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX"); // Other RPCs should remain unchanged. assertEq(getChain(31337).rpcUrl, "http://127.0.0.1:8545"); assertEq(getChain("sepolia").rpcUrl, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001"); } - function testFuzz_Rpc(string memory rpcAlias) internal { + // Named with a leading underscore to clarify this is not intended to be run as a normal test, + // and is intended to be used in the below `test_Rpcs` test. + function _testRpc(string memory rpcAlias) internal { string memory rpcUrl = getChain(rpcAlias).rpcUrl; vm.createSelectFork(rpcUrl); } // Ensure we can connect to the default RPC URL for each chain. - // function testRpcs() public { - // testRpc("mainnet"); - // testRpc("goerli"); - // testRpc("sepolia"); - // testRpc("optimism"); - // testRpc("optimism_goerli"); - // testRpc("arbitrum_one"); - // testRpc("arbitrum_one_goerli"); - // testRpc("arbitrum_nova"); - // testRpc("polygon"); - // testRpc("polygon_mumbai"); - // testRpc("avalanche"); - // testRpc("avalanche_fuji"); - // testRpc("bnb_smart_chain"); - // testRpc("bnb_smart_chain_testnet"); - // testRpc("gnosis_chain"); - // testRpc("moonbeam"); - // testRpc("moonriver"); - // testRpc("moonbase"); - // testRpc("base_goerli"); - // testRpc("base"); + // Currently commented out since this is slow and public RPCs are flaky, often resulting in failing CI. + // function test_Rpcs() public { + // _testRpc("mainnet"); + // _testRpc("sepolia"); + // _testRpc("holesky"); + // _testRpc("optimism"); + // _testRpc("optimism_sepolia"); + // _testRpc("arbitrum_one"); + // _testRpc("arbitrum_one_sepolia"); + // _testRpc("arbitrum_nova"); + // _testRpc("polygon"); + // _testRpc("polygon_amoy"); + // _testRpc("avalanche"); + // _testRpc("avalanche_fuji"); + // _testRpc("bnb_smart_chain"); + // _testRpc("bnb_smart_chain_testnet"); + // _testRpc("gnosis_chain"); + // _testRpc("moonbeam"); + // _testRpc("moonriver"); + // _testRpc("moonbase"); + // _testRpc("base_sepolia"); + // _testRpc("base"); + // _testRpc("fraxtal"); + // _testRpc("fraxtal_testnet"); // } function test_ChainNoDefault() public { diff --git a/packages/foundry/lib/forge-std/test/StdCheats.t.sol b/packages/foundry/lib/forge-std/test/StdCheats.t.sol index e94923c..7bac428 100644 --- a/packages/foundry/lib/forge-std/test/StdCheats.t.sol +++ b/packages/foundry/lib/forge-std/test/StdCheats.t.sol @@ -4,6 +4,8 @@ pragma solidity >=0.7.0 <0.9.0; import "../src/StdCheats.sol"; import "../src/Test.sol"; import "../src/StdJson.sol"; +import "../src/StdToml.sol"; +import "../src/interfaces/IERC20.sol"; contract StdCheatsTest is Test { Bar test; @@ -233,14 +235,14 @@ contract StdCheatsTest is Test { assertEq(privateKey, 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80); } - function test_BytesToUint() public { + function test_BytesToUint() public pure { assertEq(3, bytesToUint_test(hex"03")); assertEq(2, bytesToUint_test(hex"02")); assertEq(255, bytesToUint_test(hex"ff")); assertEq(29625, bytesToUint_test(hex"73b9")); } - function test_ParseJsonTxDetail() public { + function test_ParseJsonTxDetail() public view { string memory root = vm.projectRoot(); string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); string memory json = vm.readFile(path); @@ -274,7 +276,7 @@ contract StdCheatsTest is Test { transactions; } - function test_ReadReceipt() public { + function test_ReadReceipt() public view { string memory root = vm.projectRoot(); string memory path = string.concat(root, "/test/fixtures/broadcast.log.json"); uint256 index = 5; @@ -305,9 +307,6 @@ contract StdCheatsTest is Test { addInLoopNoGasNoGas(); uint256 gas_used_double = gas_start_double - gasleft(); - emit log_named_uint("Normal gas", gas_used_normal); - emit log_named_uint("Single modifier gas", gas_used_single); - emit log_named_uint("Double modifier gas", gas_used_double); assertTrue(gas_used_double + gas_used_single < gas_used_normal); } @@ -401,14 +400,14 @@ contract StdCheatsTest is Test { } function testFuzz_AssumeNotPrecompile(address addr) external { - assumeNotPrecompile(addr, getChain("optimism_goerli").chainId); + assumeNotPrecompile(addr, getChain("optimism_sepolia").chainId); assertTrue( addr < address(1) || (addr > address(9) && addr < address(0x4200000000000000000000000000000000000000)) || addr > address(0x4200000000000000000000000000000000000800) ); } - function testFuzz_AssumeNotForgeAddress(address addr) external { + function testFuzz_AssumeNotForgeAddress(address addr) external pure { assumeNotForgeAddress(addr); assertTrue( addr != address(vm) && addr != 0x000000000000000000636F6e736F6c652e6c6f67 @@ -479,7 +478,7 @@ contract StdCheatsForkTest is Test { stdCheatsMock.exposed_assumeNotBlacklisted(eoa, address(0)); } - function testFuzz_AssumeNotBlacklisted_TokenWithoutBlacklist(address addr) external { + function testFuzz_AssumeNotBlacklisted_TokenWithoutBlacklist(address addr) external view { assumeNotBlacklisted(SHIB, addr); assertTrue(true); } @@ -491,7 +490,7 @@ contract StdCheatsForkTest is Test { stdCheatsMock.exposed_assumeNotBlacklisted(USDC, USDC_BLACKLISTED_USER); } - function testFuzz_AssumeNotBlacklisted_USDC(address addr) external { + function testFuzz_AssumeNotBlacklisted_USDC(address addr) external view { assumeNotBlacklisted(USDC, addr); assertFalse(USDCLike(USDC).isBlacklisted(addr)); } @@ -503,10 +502,19 @@ contract StdCheatsForkTest is Test { stdCheatsMock.exposed_assumeNotBlacklisted(USDT, USDT_BLACKLISTED_USER); } - function testFuzz_AssumeNotBlacklisted_USDT(address addr) external { + function testFuzz_AssumeNotBlacklisted_USDT(address addr) external view { assumeNotBlacklisted(USDT, addr); assertFalse(USDTLike(USDT).isBlackListed(addr)); } + + function test_dealUSDC() external { + // roll fork to the point when USDC contract updated to store balance in packed slots + vm.rollFork(19279215); + + uint256 balance = 100e6; + deal(USDC, address(this), balance); + assertEq(IERC20(USDC).balanceOf(address(this)), balance); + } } contract Bar { diff --git a/packages/foundry/lib/forge-std/test/StdJson.t.sol b/packages/foundry/lib/forge-std/test/StdJson.t.sol new file mode 100644 index 0000000..e32b92e --- /dev/null +++ b/packages/foundry/lib/forge-std/test/StdJson.t.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/Test.sol"; + +contract StdJsonTest is Test { + using stdJson for string; + + string root; + string path; + + function setUp() public { + root = vm.projectRoot(); + path = string.concat(root, "/test/fixtures/test.json"); + } + + struct SimpleJson { + uint256 a; + string b; + } + + struct NestedJson { + uint256 a; + string b; + SimpleJson c; + } + + function test_readJson() public view { + string memory json = vm.readFile(path); + assertEq(json.readUint(".a"), 123); + } + + function test_writeJson() public { + string memory json = "json"; + json.serialize("a", uint256(123)); + string memory semiFinal = json.serialize("b", string("test")); + string memory finalJson = json.serialize("c", semiFinal); + finalJson.write(path); + + string memory json_ = vm.readFile(path); + bytes memory data = json_.parseRaw("$"); + NestedJson memory decodedData = abi.decode(data, (NestedJson)); + + assertEq(decodedData.a, 123); + assertEq(decodedData.b, "test"); + assertEq(decodedData.c.a, 123); + assertEq(decodedData.c.b, "test"); + } +} diff --git a/packages/foundry/lib/forge-std/test/StdMath.t.sol b/packages/foundry/lib/forge-std/test/StdMath.t.sol index 6f50638..ed0f9ba 100644 --- a/packages/foundry/lib/forge-std/test/StdMath.t.sol +++ b/packages/foundry/lib/forge-std/test/StdMath.t.sol @@ -15,7 +15,7 @@ contract StdMathMock is Test { } contract StdMathTest is Test { - function test_GetAbs() external { + function test_GetAbs() external pure { assertEq(stdMath.abs(-50), 50); assertEq(stdMath.abs(50), 50); assertEq(stdMath.abs(-1337), 1337); @@ -25,7 +25,7 @@ contract StdMathTest is Test { assertEq(stdMath.abs(type(int256).max), (type(uint256).max >> 1)); } - function testFuzz_GetAbs(int256 a) external { + function testFuzz_GetAbs(int256 a) external pure { uint256 manualAbs = getAbs(a); uint256 abs = stdMath.abs(a); @@ -33,7 +33,7 @@ contract StdMathTest is Test { assertEq(abs, manualAbs); } - function test_GetDelta_Uint() external { + function test_GetDelta_Uint() external pure { assertEq(stdMath.delta(uint256(0), uint256(0)), 0); assertEq(stdMath.delta(uint256(0), uint256(1337)), 1337); assertEq(stdMath.delta(uint256(0), type(uint64).max), type(uint64).max); @@ -51,7 +51,7 @@ contract StdMathTest is Test { assertEq(stdMath.delta(5000, uint256(1250)), 3750); } - function testFuzz_GetDelta_Uint(uint256 a, uint256 b) external { + function testFuzz_GetDelta_Uint(uint256 a, uint256 b) external pure { uint256 manualDelta; if (a > b) { manualDelta = a - b; @@ -64,7 +64,7 @@ contract StdMathTest is Test { assertEq(delta, manualDelta); } - function test_GetDelta_Int() external { + function test_GetDelta_Int() external pure { assertEq(stdMath.delta(int256(0), int256(0)), 0); assertEq(stdMath.delta(int256(0), int256(1337)), 1337); assertEq(stdMath.delta(int256(0), type(int64).max), type(uint64).max >> 1); @@ -96,7 +96,7 @@ contract StdMathTest is Test { assertEq(stdMath.delta(5000, int256(1250)), 3750); } - function testFuzz_GetDelta_Int(int256 a, int256 b) external { + function testFuzz_GetDelta_Int(int256 a, int256 b) external pure { uint256 absA = getAbs(a); uint256 absB = getAbs(b); uint256 absDelta = absA > absB ? absA - absB : absB - absA; @@ -134,7 +134,7 @@ contract StdMathTest is Test { stdMathMock.exposed_percentDelta(uint256(1), 0); } - function testFuzz_GetPercentDelta_Uint(uint192 a, uint192 b) external { + function testFuzz_GetPercentDelta_Uint(uint192 a, uint192 b) external pure { vm.assume(b != 0); uint256 manualDelta; if (a > b) { @@ -177,7 +177,7 @@ contract StdMathTest is Test { stdMathMock.exposed_percentDelta(int256(1), 0); } - function testFuzz_GetPercentDelta_Int(int192 a, int192 b) external { + function testFuzz_GetPercentDelta_Int(int192 a, int192 b) external pure { vm.assume(b != 0); uint256 absA = getAbs(a); uint256 absB = getAbs(b); diff --git a/packages/foundry/lib/forge-std/test/StdStorage.t.sol b/packages/foundry/lib/forge-std/test/StdStorage.t.sol index 0b3ca9b..e1e6aa0 100644 --- a/packages/foundry/lib/forge-std/test/StdStorage.t.sol +++ b/packages/foundry/lib/forge-std/test/StdStorage.t.sol @@ -178,13 +178,17 @@ contract StdStorageTest is Test { assertTrue(test.map_bool(address(this))); } - function testFail_StorageCheckedWriteMapPacked() public { - // expect PackedSlot error but not external call so cant expectRevert - stdstore.target(address(test)).sig(test.read_struct_lower.selector).with_key(address(uint160(1337))) - .checked_write(100); + function testFuzz_StorageCheckedWriteMapPacked(address addr, uint128 value) public { + stdstore.enable_packed_slots().target(address(test)).sig(test.read_struct_lower.selector).with_key(addr) + .checked_write(value); + assertEq(test.read_struct_lower(addr), value); + + stdstore.enable_packed_slots().target(address(test)).sig(test.read_struct_upper.selector).with_key(addr) + .checked_write(value); + assertEq(test.read_struct_upper(addr), value); } - function test_StorageCheckedWriteMapPackedSuccess() public { + function test_StorageCheckedWriteMapPackedFullSuccess() public { uint256 full = test.map_packed(address(1337)); // keep upper 128, set lower 128 to 1337 full = (full & (uint256((1 << 128) - 1) << 128)) | 1337; @@ -199,13 +203,16 @@ contract StdStorageTest is Test { stdstore.target(address(test)).sig("const()").find(); } - function testFail_StorageNativePack() public { - stdstore.target(address(test)).sig(test.tA.selector).find(); - stdstore.target(address(test)).sig(test.tB.selector).find(); + function testFuzz_StorageNativePack(uint248 val1, uint248 val2, bool boolVal1, bool boolVal2) public { + stdstore.enable_packed_slots().target(address(test)).sig(test.tA.selector).checked_write(val1); + stdstore.enable_packed_slots().target(address(test)).sig(test.tB.selector).checked_write(boolVal1); + stdstore.enable_packed_slots().target(address(test)).sig(test.tC.selector).checked_write(boolVal2); + stdstore.enable_packed_slots().target(address(test)).sig(test.tD.selector).checked_write(val2); - // these both would fail - stdstore.target(address(test)).sig(test.tC.selector).find(); - stdstore.target(address(test)).sig(test.tD.selector).find(); + assertEq(test.tA(), val1); + assertEq(test.tB(), boolVal1); + assertEq(test.tC(), boolVal2); + assertEq(test.tD(), val2); } function test_StorageReadBytes32() public { @@ -246,6 +253,98 @@ contract StdStorageTest is Test { int256 val = stdstore.target(address(test)).sig(test.tG.selector).read_int(); assertEq(val, type(int256).min); } + + function testFuzzPacked(uint256 val, uint8 elemToGet) public { + // This function tries an assortment of packed slots, shifts meaning number of elements + // that are packed. Shiftsizes are the size of each element, i.e. 8 means a data type that is 8 bits, 16 == 16 bits, etc. + // Combined, these determine how a slot is packed. Making it random is too hard to avoid global rejection limit + // and make it performant. + + // change the number of shifts + for (uint256 i = 1; i < 5; i++) { + uint256 shifts = i; + + elemToGet = uint8(bound(elemToGet, 0, shifts - 1)); + + uint256[] memory shiftSizes = new uint256[](shifts); + for (uint256 j; j < shifts; j++) { + shiftSizes[j] = 8 * (j + 1); + } + + test.setRandomPacking(val); + + uint256 leftBits; + uint256 rightBits; + for (uint256 j; j < shiftSizes.length; j++) { + if (j < elemToGet) { + leftBits += shiftSizes[j]; + } else if (elemToGet != j) { + rightBits += shiftSizes[j]; + } + } + + // we may have some right bits unaccounted for + leftBits += 256 - (leftBits + shiftSizes[elemToGet] + rightBits); + // clear left bits, then clear right bits and realign + uint256 expectedValToRead = (val << leftBits) >> (leftBits + rightBits); + + uint256 readVal = stdstore.target(address(test)).enable_packed_slots().sig( + "getRandomPacked(uint8,uint8[],uint8)" + ).with_calldata(abi.encode(shifts, shiftSizes, elemToGet)).read_uint(); + + assertEq(readVal, expectedValToRead); + } + } + + function testFuzzPacked2(uint256 nvars, uint256 seed) public { + // Number of random variables to generate. + nvars = bound(nvars, 1, 20); + + // This will decrease as we generate values in the below loop. + uint256 bitsRemaining = 256; + + // Generate a random value and size for each variable. + uint256[] memory vals = new uint256[](nvars); + uint256[] memory sizes = new uint256[](nvars); + uint256[] memory offsets = new uint256[](nvars); + + for (uint256 i = 0; i < nvars; i++) { + // Generate a random value and size. + offsets[i] = i == 0 ? 0 : offsets[i - 1] + sizes[i - 1]; + + uint256 nvarsRemaining = nvars - i; + uint256 maxVarSize = bitsRemaining - nvarsRemaining + 1; + sizes[i] = bound(uint256(keccak256(abi.encodePacked(seed, i + 256))), 1, maxVarSize); + bitsRemaining -= sizes[i]; + + uint256 maxVal; + uint256 varSize = sizes[i]; + assembly { + // mask = (1 << varSize) - 1 + maxVal := sub(shl(varSize, 1), 1) + } + vals[i] = bound(uint256(keccak256(abi.encodePacked(seed, i))), 0, maxVal); + } + + // Pack all values into the slot. + for (uint256 i = 0; i < nvars; i++) { + stdstore.enable_packed_slots().target(address(test)).sig("getRandomPacked(uint256,uint256)").with_key( + sizes[i] + ).with_key(offsets[i]).checked_write(vals[i]); + } + + // Verify the read data matches. + for (uint256 i = 0; i < nvars; i++) { + uint256 readVal = stdstore.enable_packed_slots().target(address(test)).sig( + "getRandomPacked(uint256,uint256)" + ).with_key(sizes[i]).with_key(offsets[i]).read_uint(); + + uint256 retVal = test.getRandomPacked(sizes[i], offsets[i]); + + assertEq(readVal, vals[i]); + assertEq(retVal, vals[i]); + } + } } contract StorageTest { @@ -277,6 +376,8 @@ contract StorageTest { bool public tH = true; bytes32 private tI = ~bytes32(hex"1337"); + uint256 randomPacking; + constructor() { basic = UnpackedStruct({a: 1337, b: 1337}); @@ -312,4 +413,51 @@ contract StorageTest { } t = tI; } + + function setRandomPacking(uint256 val) public { + randomPacking = val; + } + + function _getMask(uint256 size) internal pure returns (uint256 mask) { + assembly { + // mask = (1 << size) - 1 + mask := sub(shl(size, 1), 1) + } + } + + function setRandomPacking(uint256 val, uint256 size, uint256 offset) public { + // Generate mask based on the size of the value + uint256 mask = _getMask(size); + // Zero out all bits for the word we're about to set + uint256 cleanedWord = randomPacking & ~(mask << offset); + // Place val in the correct spot of the cleaned word + randomPacking = cleanedWord | val << offset; + } + + function getRandomPacked(uint256 size, uint256 offset) public view returns (uint256) { + // Generate mask based on the size of the value + uint256 mask = _getMask(size); + // Shift to place the bits in the correct position, and use mask to zero out remaining bits + return (randomPacking >> offset) & mask; + } + + function getRandomPacked(uint8 shifts, uint8[] memory shiftSizes, uint8 elem) public view returns (uint256) { + require(elem < shifts, "!elem"); + uint256 leftBits; + uint256 rightBits; + + for (uint256 i; i < shiftSizes.length; i++) { + if (i < elem) { + leftBits += shiftSizes[i]; + } else if (elem != i) { + rightBits += shiftSizes[i]; + } + } + + // we may have some right bits unaccounted for + leftBits += 256 - (leftBits + shiftSizes[elem] + rightBits); + + // clear left bits, then clear right bits and realign + return (randomPacking << leftBits) >> (leftBits + rightBits); + } } diff --git a/packages/foundry/lib/forge-std/test/StdToml.t.sol b/packages/foundry/lib/forge-std/test/StdToml.t.sol new file mode 100644 index 0000000..631b1b5 --- /dev/null +++ b/packages/foundry/lib/forge-std/test/StdToml.t.sol @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.7.0 <0.9.0; + +import "../src/Test.sol"; + +contract StdTomlTest is Test { + using stdToml for string; + + string root; + string path; + + function setUp() public { + root = vm.projectRoot(); + path = string.concat(root, "/test/fixtures/test.toml"); + } + + struct SimpleToml { + uint256 a; + string b; + } + + struct NestedToml { + uint256 a; + string b; + SimpleToml c; + } + + function test_readToml() public view { + string memory json = vm.readFile(path); + assertEq(json.readUint(".a"), 123); + } + + function test_writeToml() public { + string memory json = "json"; + json.serialize("a", uint256(123)); + string memory semiFinal = json.serialize("b", string("test")); + string memory finalJson = json.serialize("c", semiFinal); + finalJson.write(path); + + string memory toml = vm.readFile(path); + bytes memory data = toml.parseRaw("$"); + NestedToml memory decodedData = abi.decode(data, (NestedToml)); + + assertEq(decodedData.a, 123); + assertEq(decodedData.b, "test"); + assertEq(decodedData.c.a, 123); + assertEq(decodedData.c.b, "test"); + } +} diff --git a/packages/foundry/lib/forge-std/test/StdUtils.t.sol b/packages/foundry/lib/forge-std/test/StdUtils.t.sol index 80acc25..4994c6c 100644 --- a/packages/foundry/lib/forge-std/test/StdUtils.t.sol +++ b/packages/foundry/lib/forge-std/test/StdUtils.t.sol @@ -30,7 +30,7 @@ contract StdUtilsTest is Test { BOUND UINT //////////////////////////////////////////////////////////////////////////*/ - function test_Bound() public { + function test_Bound() public pure { assertEq(bound(uint256(5), 0, 4), 0); assertEq(bound(uint256(0), 69, 69), 69); assertEq(bound(uint256(0), 68, 69), 68); @@ -39,14 +39,14 @@ contract StdUtilsTest is Test { assertEq(bound(uint256(9999), 1337, 6666), 4669); } - function test_Bound_WithinRange() public { + function test_Bound_WithinRange() public pure { assertEq(bound(uint256(51), 50, 150), 51); assertEq(bound(uint256(51), 50, 150), bound(bound(uint256(51), 50, 150), 50, 150)); assertEq(bound(uint256(149), 50, 150), 149); assertEq(bound(uint256(149), 50, 150), bound(bound(uint256(149), 50, 150), 50, 150)); } - function test_Bound_EdgeCoverage() public { + function test_Bound_EdgeCoverage() public pure { assertEq(bound(uint256(0), 50, 150), 50); assertEq(bound(uint256(1), 50, 150), 51); assertEq(bound(uint256(2), 50, 150), 52); @@ -57,7 +57,7 @@ contract StdUtilsTest is Test { assertEq(bound(type(uint256).max - 3, 50, 150), 147); } - function test_Bound_DistributionIsEven(uint256 min, uint256 size) public { + function test_Bound_DistributionIsEven(uint256 min, uint256 size) public pure { size = size % 100 + 1; min = bound(min, UINT256_MAX / 2, UINT256_MAX / 2 + size); uint256 max = min + size - 1; @@ -73,7 +73,7 @@ contract StdUtilsTest is Test { } } - function test_Bound(uint256 num, uint256 min, uint256 max) public { + function test_Bound(uint256 num, uint256 min, uint256 max) public pure { if (min > max) (min, max) = (max, min); uint256 result = bound(num, min, max); @@ -84,7 +84,7 @@ contract StdUtilsTest is Test { if (num >= min && num <= max) assertEq(result, num); } - function test_BoundUint256Max() public { + function test_BoundUint256Max() public pure { assertEq(bound(0, type(uint256).max - 1, type(uint256).max), type(uint256).max - 1); assertEq(bound(1, type(uint256).max - 1, type(uint256).max), type(uint256).max); } @@ -110,7 +110,7 @@ contract StdUtilsTest is Test { BOUND INT //////////////////////////////////////////////////////////////////////////*/ - function test_BoundInt() public { + function test_BoundInt() public pure { assertEq(bound(-3, 0, 4), 2); assertEq(bound(0, -69, -69), -69); assertEq(bound(0, -69, -68), -68); @@ -119,14 +119,14 @@ contract StdUtilsTest is Test { assertEq(bound(9999, -1337, 6666), 1995); } - function test_BoundInt_WithinRange() public { + function test_BoundInt_WithinRange() public pure { assertEq(bound(51, -50, 150), 51); assertEq(bound(51, -50, 150), bound(bound(51, -50, 150), -50, 150)); assertEq(bound(149, -50, 150), 149); assertEq(bound(149, -50, 150), bound(bound(149, -50, 150), -50, 150)); } - function test_BoundInt_EdgeCoverage() public { + function test_BoundInt_EdgeCoverage() public pure { assertEq(bound(type(int256).min, -50, 150), -50); assertEq(bound(type(int256).min + 1, -50, 150), -49); assertEq(bound(type(int256).min + 2, -50, 150), -48); @@ -146,7 +146,7 @@ contract StdUtilsTest is Test { assertEq(bound(type(int256).max - 3, -50, -10), -13); } - function test_BoundInt_DistributionIsEven(int256 min, uint256 size) public { + function test_BoundInt_DistributionIsEven(int256 min, uint256 size) public pure { size = size % 100 + 1; min = bound(min, -int256(size / 2), int256(size - size / 2)); int256 max = min + int256(size) - 1; @@ -162,7 +162,7 @@ contract StdUtilsTest is Test { } } - function test_BoundInt(int256 num, int256 min, int256 max) public { + function test_BoundInt(int256 num, int256 min, int256 max) public pure { if (min > max) (min, max) = (max, min); int256 result = bound(num, min, max); @@ -173,12 +173,12 @@ contract StdUtilsTest is Test { if (num >= min && num <= max) assertEq(result, num); } - function test_BoundIntInt256Max() public { + function test_BoundIntInt256Max() public pure { assertEq(bound(0, type(int256).max - 1, type(int256).max), type(int256).max - 1); assertEq(bound(1, type(int256).max - 1, type(int256).max), type(int256).max); } - function test_BoundIntInt256Min() public { + function test_BoundIntInt256Min() public pure { assertEq(bound(0, type(int256).min, type(int256).min + 1), type(int256).min); assertEq(bound(1, type(int256).min, type(int256).min + 1), type(int256).min + 1); } @@ -204,7 +204,7 @@ contract StdUtilsTest is Test { BOUND PRIVATE KEY //////////////////////////////////////////////////////////////////////////*/ - function test_BoundPrivateKey() public { + function test_BoundPrivateKey() public pure { assertEq(boundPrivateKey(0), 1); assertEq(boundPrivateKey(1), 1); assertEq(boundPrivateKey(300), 300); @@ -219,7 +219,7 @@ contract StdUtilsTest is Test { BYTES TO UINT //////////////////////////////////////////////////////////////////////////*/ - function test_BytesToUint() external { + function test_BytesToUint() external pure { bytes memory maxUint = hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; bytes memory two = hex"02"; bytes memory millionEther = hex"d3c21bcecceda1000000"; @@ -242,7 +242,7 @@ contract StdUtilsTest is Test { COMPUTE CREATE ADDRESS //////////////////////////////////////////////////////////////////////////*/ - function test_ComputeCreateAddress() external { + function test_ComputeCreateAddress() external pure { address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; uint256 nonce = 14; address createAddress = computeCreateAddress(deployer, nonce); @@ -253,7 +253,7 @@ contract StdUtilsTest is Test { COMPUTE CREATE2 ADDRESS //////////////////////////////////////////////////////////////////////////*/ - function test_ComputeCreate2Address() external { + function test_ComputeCreate2Address() external pure { bytes32 salt = bytes32(uint256(31415)); bytes32 initcodeHash = keccak256(abi.encode(0x6080)); address deployer = 0x6C9FC64A53c1b71FB3f9Af64d1ae3A4931A5f4E9; @@ -261,7 +261,7 @@ contract StdUtilsTest is Test { assertEq(create2Address, 0xB147a5d25748fda14b463EB04B111027C290f4d3); } - function test_ComputeCreate2AddressWithDefaultDeployer() external { + function test_ComputeCreate2AddressWithDefaultDeployer() external pure { bytes32 salt = 0xc290c670fde54e5ef686f9132cbc8711e76a98f0333a438a92daa442c71403c0; bytes32 initcodeHash = hashInitCode(hex"6080", ""); assertEq(initcodeHash, 0x1a578b7a4b0b5755db6d121b4118d4bc68fe170dca840c59bc922f14175a76b0); diff --git a/packages/foundry/lib/forge-std/test/Vm.t.sol b/packages/foundry/lib/forge-std/test/Vm.t.sol index 95d6145..6424212 100644 --- a/packages/foundry/lib/forge-std/test/Vm.t.sol +++ b/packages/foundry/lib/forge-std/test/Vm.t.sol @@ -8,8 +8,8 @@ contract VmTest is Test { // This test ensures that functions are never accidentally removed from a Vm interface, or // inadvertently moved between Vm and VmSafe. This test must be updated each time a function is // added to or removed from Vm or VmSafe. - function test_interfaceId() public { - assertEq(type(VmSafe).interfaceId, bytes4(0x01ec102d), "VmSafe"); - assertEq(type(Vm).interfaceId, bytes4(0xa63eed6b), "Vm"); + function test_interfaceId() public pure { + assertEq(type(VmSafe).interfaceId, bytes4(0x536a6b28), "VmSafe"); + assertEq(type(Vm).interfaceId, bytes4(0xb91a22ba), "Vm"); } } diff --git a/packages/foundry/lib/forge-std/test/fixtures/test.json b/packages/foundry/lib/forge-std/test/fixtures/test.json new file mode 100644 index 0000000..caebf6d --- /dev/null +++ b/packages/foundry/lib/forge-std/test/fixtures/test.json @@ -0,0 +1,8 @@ +{ + "a": 123, + "b": "test", + "c": { + "a": 123, + "b": "test" + } +} \ No newline at end of file diff --git a/packages/foundry/lib/forge-std/test/fixtures/test.toml b/packages/foundry/lib/forge-std/test/fixtures/test.toml new file mode 100644 index 0000000..60692bc --- /dev/null +++ b/packages/foundry/lib/forge-std/test/fixtures/test.toml @@ -0,0 +1,6 @@ +a = 123 +b = "test" + +[c] +a = 123 +b = "test" diff --git a/packages/foundry/lib/forge-std/test/mocks/MockERC20.t.sol b/packages/foundry/lib/forge-std/test/mocks/MockERC20.t.sol index 3649e60..e246810 100644 --- a/packages/foundry/lib/forge-std/test/mocks/MockERC20.t.sol +++ b/packages/foundry/lib/forge-std/test/mocks/MockERC20.t.sol @@ -29,7 +29,7 @@ contract MockERC20Test is StdCheats, Test { token = new Token_ERC20("Token", "TKN", 18); } - function invariantMetadata() public { + function invariantMetadata() public view { assertEq(token.name(), "Token"); assertEq(token.symbol(), "TKN"); assertEq(token.decimals(), 18); diff --git a/packages/foundry/lib/forge-std/test/mocks/MockERC721.t.sol b/packages/foundry/lib/forge-std/test/mocks/MockERC721.t.sol index 3bf84c9..f986d79 100644 --- a/packages/foundry/lib/forge-std/test/mocks/MockERC721.t.sol +++ b/packages/foundry/lib/forge-std/test/mocks/MockERC721.t.sol @@ -71,7 +71,7 @@ contract MockERC721Test is StdCheats, Test { token = new Token_ERC721("Token", "TKN"); } - function invariantMetadata() public { + function invariantMetadata() public view { assertEq(token.name(), "Token"); assertEq(token.symbol(), "TKN"); } diff --git a/packages/foundry/lib/openzeppelin-contracts/CHANGELOG.md b/packages/foundry/lib/openzeppelin-contracts/CHANGELOG.md index 2dee312..d464a4e 100644 --- a/packages/foundry/lib/openzeppelin-contracts/CHANGELOG.md +++ b/packages/foundry/lib/openzeppelin-contracts/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +## 5.0.2 (2024-02-29) + +- `Base64`: Fix issue where dirty memory located just after the input buffer is affecting the result. ([#4926](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4926)) + ## 5.0.1 (2023-12-07) - `ERC2771Context` and `Context`: Introduce a `_contextPrefixLength()` getter, used to trim extra information appended to `msg.data`. diff --git a/packages/foundry/lib/openzeppelin-contracts/README.md b/packages/foundry/lib/openzeppelin-contracts/README.md index 9ca4157..06f5455 100644 --- a/packages/foundry/lib/openzeppelin-contracts/README.md +++ b/packages/foundry/lib/openzeppelin-contracts/README.md @@ -14,7 +14,7 @@ :mage: **Not sure how to get started?** Check out [Contracts Wizard](https://wizard.openzeppelin.com/) โ€” an interactive smart contract generator. -:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) โ€” a secure platform for automating and monitoring your operations. +:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) โ€” a mission-critical developer security platform to code, audit, deploy, monitor, and operate with confidence. > [!IMPORTANT] > OpenZeppelin Contracts uses semantic versioning to communicate backwards compatibility of its API and storage layout. For upgradeable contracts, the storage layout of different major versions should be assumed incompatible, for example, it is unsafe to upgrade from 4.9.3 to 5.0.0. Learn more at [Backwards Compatibility](https://docs.openzeppelin.com/contracts/backwards-compatibility). diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/access/README.adoc b/packages/foundry/lib/openzeppelin-contracts/contracts/access/README.adoc index ba9c02f..b89865b 100644 --- a/packages/foundry/lib/openzeppelin-contracts/contracts/access/README.adoc +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/access/README.adoc @@ -5,7 +5,9 @@ NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/ This directory provides ways to restrict who can access the functions of a contract or when they can do it. -- {AccessControl} provides a general role based access control mechanism. Multiple hierarchical roles can be created and assigned each to multiple accounts. +- {AccessManager} is a full-fledged access control solution for smart contract systems. Allows creating and assigning multiple hierarchical roles with execution delays for each account across various contracts. +- {AccessManaged} delegates its access control to an authority that dictates the permissions of the managed contract. It's compatible with an AccessManager as an authority. +- {AccessControl} provides a per-contract role based access control mechanism. Multiple hierarchical roles can be created and assigned each to multiple accounts within the same instance. - {Ownable} is a simpler mechanism with a single owner "role" that can be assigned to a single account. This simpler mechanism can be useful for quick tests but projects with production concerns are likely to outgrow it. == Core diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/governance/README.adoc b/packages/foundry/lib/openzeppelin-contracts/contracts/governance/README.adoc index 5b38c4d..8c368ac 100644 --- a/packages/foundry/lib/openzeppelin-contracts/contracts/governance/README.adoc +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/governance/README.adoc @@ -30,6 +30,8 @@ Counting modules determine valid voting options. Timelock extensions add a delay for governance decisions to be executed. The workflow is extended to require a `queue` step before execution. With these modules, proposals are executed by the external timelock contract, thus it is the timelock that has to hold the assets that are being governed. +* {GovernorTimelockAccess}: Connects with an instance of an {AccessManager}. This allows restrictions (and delays) enforced by the manager to be considered by the Governor and integrated into the AccessManager's "schedule + execute" workflow. + * {GovernorTimelockControl}: Connects with an instance of {TimelockController}. Allows multiple proposers and executors, in addition to the Governor itself. * {GovernorTimelockCompound}: Connects with an instance of Compound's https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol[`Timelock`] contract. @@ -66,6 +68,8 @@ NOTE: Functions of the `Governor` contract do not include access control. If you === Extensions +{{GovernorTimelockAccess}} + {{GovernorTimelockControl}} {{GovernorTimelockCompound}} diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/metatx/README.adoc b/packages/foundry/lib/openzeppelin-contracts/contracts/metatx/README.adoc index 9f25802..c02fb10 100644 --- a/packages/foundry/lib/openzeppelin-contracts/contracts/metatx/README.adoc +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/metatx/README.adoc @@ -3,6 +3,11 @@ [.readme-notice] NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/metatx +This directory includes contracts for adding meta-transaction capabilities (i.e. abstracting the execution context from the transaction origin) following the https://eips.ethereum.org/EIPS/eip-2771[ERC-2771 specification]. + +- {ERC2771Context}: Provides a mechanism to override the sender and calldata of the execution context (`msg.sender` and `msg.data`) with a custom value specified by a trusted forwarder. +- {ERC2771Forwarder}: A production-ready forwarder that relays operation requests signed off-chain by an EOA. + == Core {{ERC2771Context}} diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/mocks/Base64Dirty.sol b/packages/foundry/lib/openzeppelin-contracts/contracts/mocks/Base64Dirty.sol new file mode 100644 index 0000000..238bd26 --- /dev/null +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/mocks/Base64Dirty.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.20; + +import {Base64} from "../utils/Base64.sol"; + +contract Base64Dirty { + struct A { + uint256 value; + } + + function encode(bytes memory input) public pure returns (string memory) { + A memory unused = A({value: type(uint256).max}); + // To silence warning + unused; + + return Base64.encode(input); + } +} diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/package.json b/packages/foundry/lib/openzeppelin-contracts/contracts/package.json index 6ab8913..845e8c4 100644 --- a/packages/foundry/lib/openzeppelin-contracts/contracts/package.json +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/package.json @@ -1,7 +1,7 @@ { "name": "@openzeppelin/contracts", "description": "Secure Smart Contract library for Solidity", - "version": "5.0.1", + "version": "5.0.2", "files": [ "**/*.sol", "/build/contracts/*.json", diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/utils/Base64.sol b/packages/foundry/lib/openzeppelin-contracts/contracts/utils/Base64.sol index f8547d1..0124cdd 100644 --- a/packages/foundry/lib/openzeppelin-contracts/contracts/utils/Base64.sol +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/utils/Base64.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v5.0.0) (utils/Base64.sol) +// OpenZeppelin Contracts (last updated v5.0.2) (utils/Base64.sol) pragma solidity ^0.8.20; @@ -39,12 +39,19 @@ library Base64 { let tablePtr := add(table, 1) // Prepare result pointer, jump over length - let resultPtr := add(result, 32) + let resultPtr := add(result, 0x20) + let dataPtr := data + let endPtr := add(data, mload(data)) + + // In some cases, the last iteration will read bytes after the end of the data. We cache the value, and + // set it to zero to make sure no dirty bytes are read in that section. + let afterPtr := add(endPtr, 0x20) + let afterCache := mload(afterPtr) + mstore(afterPtr, 0x00) // Run over the input, 3 bytes at a time for { - let dataPtr := data - let endPtr := add(data, mload(data)) + } lt(dataPtr, endPtr) { } { @@ -52,13 +59,12 @@ library Base64 { dataPtr := add(dataPtr, 3) let input := mload(dataPtr) - // To write each character, shift the 3 bytes (18 bits) chunk + // To write each character, shift the 3 byte (24 bits) chunk // 4 times in blocks of 6 bits for each character (18, 12, 6, 0) - // and apply logical AND with 0x3F which is the number of - // the previous character in the ASCII table prior to the Base64 Table - // The result is then added to the table to get the character to write, - // and finally write it in the result pointer but with a left shift - // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits + // and apply logical AND with 0x3F to bitmask the least significant 6 bits. + // Use this as an index into the lookup table, mload an entire word + // so the desired character is in the least significant byte, and + // mstore8 this least significant byte into the result and continue. mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F)))) resultPtr := add(resultPtr, 1) // Advance @@ -73,6 +79,9 @@ library Base64 { resultPtr := add(resultPtr, 1) // Advance } + // Reset the value that was cached + mstore(afterPtr, afterCache) + // When data `bytes` is not exactly 3 bytes long // it is padded with `=` characters at the end switch mod(mload(data), 3) diff --git a/packages/foundry/lib/openzeppelin-contracts/contracts/utils/README.adoc b/packages/foundry/lib/openzeppelin-contracts/contracts/utils/README.adoc index d88b001..089f2ef 100644 --- a/packages/foundry/lib/openzeppelin-contracts/contracts/utils/README.adoc +++ b/packages/foundry/lib/openzeppelin-contracts/contracts/utils/README.adoc @@ -5,14 +5,30 @@ NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/ Miscellaneous contracts and libraries containing utility functions you can use to improve security, work with new data types, or safely use low-level primitives. + * {Math}, {SignedMath}: Implementation of various arithmetic functions. + * {SafeCast}: Checked downcasting functions to avoid silent truncation. + * {ECDSA}, {MessageHashUtils}: Libraries for interacting with ECDSA signatures. + * {SignatureChecker}: A library helper to support regular ECDSA from EOAs as well as ERC-1271 signatures for smart contracts. + * {MerkleProof}: Functions for verifying https://en.wikipedia.org/wiki/Merkle_tree[Merkle Tree] proofs. + * {EIP712}: Contract with functions to allow processing signed typed structure data according to https://eips.ethereum.org/EIPS/eip-712[EIP-712]. * {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions. * {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending. - * {SafeCast}: Checked downcasting functions to avoid silent truncation. - * {Math}, {SignedMath}: Implementation of various arithmetic functions. - * {Multicall}: Simple way to batch together multiple calls in a single external call. - * {Create2}: Wrapper around the https://blog.openzeppelin.com/getting-the-most-out-of-create2/[`CREATE2` EVM opcode] for safe use without having to deal with low-level assembly. + * {Nonces}: Utility for tracking and verifying address nonces that only increment. + * {ERC165, ERC165Checker}: Utilities for inspecting interfaces supported by contracts. + * {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way. * {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`). * {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc. + * {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be removed added or remove from both sides. Useful for FIFO and LIFO structures. + * {Checkpoints}: A data structure to store values mapped to an strictly increasing key. Can be used for storing and accessing values over time. + * {Create2}: Wrapper around the https://blog.openzeppelin.com/getting-the-most-out-of-create2/[`CREATE2` EVM opcode] for safe use without having to deal with low-level assembly. + * {Address}: Collection of functions for overloading Solidity's https://docs.soliditylang.org/en/latest/types.html#address[`address`] type. + * {Arrays}: Collection of functions that operate on https://docs.soliditylang.org/en/latest/types.html#arrays[`arrays`]. + * {Base64}: On-chain base64 and base64URL encoding according to https://datatracker.ietf.org/doc/html/rfc4648[RFC-4648]. + * {Strings}: Common operations for strings formatting. + * {ShortString}: Library to encode (and decode) short strings into (or from) a single bytes32 slot for optimizing costs. Short strings are limited to 31 characters. + * {StorageSlot}: Methods for accessing specific storage slots formatted as common primitive types. + * {Multicall}: Abstract contract with an utility to allow batching together multiple calls in a single transaction. Useful for allowing EOAs to perform multiple operations at once. + * {Context}: An utility for abstracting the sender and calldata in the current execution context. [NOTE] ==== @@ -45,6 +61,8 @@ Because Solidity does not support generic types, {EnumerableMap} and {Enumerable {{Pausable}} +{{Nonces}} + == Introspection This set of interfaces and contracts deal with https://en.wikipedia.org/wiki/Type_introspection[type introspection] of contracts, that is, examining which functions can be called on them. This is usually referred to as a contract's _interface_. @@ -86,3 +104,5 @@ Ethereum contracts have no native concept of an interface, so applications must {{StorageSlot}} {{Multicall}} + +{{Context}} diff --git a/packages/foundry/lib/openzeppelin-contracts/package-lock.json b/packages/foundry/lib/openzeppelin-contracts/package-lock.json index 0f4f9f5..cf544ed 100644 --- a/packages/foundry/lib/openzeppelin-contracts/package-lock.json +++ b/packages/foundry/lib/openzeppelin-contracts/package-lock.json @@ -1,12 +1,12 @@ { "name": "openzeppelin-solidity", - "version": "4.9.2", + "version": "5.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openzeppelin-solidity", - "version": "4.9.2", + "version": "5.0.1", "license": "MIT", "devDependencies": { "@changesets/changelog-github": "^0.4.8", diff --git a/packages/foundry/lib/openzeppelin-contracts/package.json b/packages/foundry/lib/openzeppelin-contracts/package.json index 1afd5b1..eb40bde 100644 --- a/packages/foundry/lib/openzeppelin-contracts/package.json +++ b/packages/foundry/lib/openzeppelin-contracts/package.json @@ -1,7 +1,7 @@ { "name": "openzeppelin-solidity", "description": "Secure Smart Contract library for Solidity", - "version": "5.0.1", + "version": "5.0.2", "private": true, "files": [ "/contracts/**/*.sol", diff --git a/packages/foundry/lib/openzeppelin-contracts/test/utils/Base64.test.js b/packages/foundry/lib/openzeppelin-contracts/test/utils/Base64.test.js index dfff0b0..c5d7add 100644 --- a/packages/foundry/lib/openzeppelin-contracts/test/utils/Base64.test.js +++ b/packages/foundry/lib/openzeppelin-contracts/test/utils/Base64.test.js @@ -1,8 +1,9 @@ const { expect } = require('chai'); const Base64 = artifacts.require('$Base64'); +const Base64Dirty = artifacts.require('$Base64Dirty'); -contract('Strings', function () { +contract('Base64', function () { beforeEach(async function () { this.base64 = await Base64.new(); }); @@ -30,4 +31,13 @@ contract('Strings', function () { expect(await this.base64.$encode([])).to.equal(''); }); }); + + it('Encode reads beyond the input buffer into dirty memory', async function () { + const mock = await Base64Dirty.new(); + const buffer32 = Buffer.from(web3.utils.soliditySha3('example').replace(/0x/, ''), 'hex'); + const buffer31 = buffer32.slice(0, -2); + + expect(await mock.encode(buffer31)).to.equal(buffer31.toString('base64')); + expect(await mock.encode(buffer32)).to.equal(buffer32.toString('base64')); + }); }); diff --git a/packages/foundry/package.json b/packages/foundry/package.json index 9471ed9..9bf2836 100644 --- a/packages/foundry/package.json +++ b/packages/foundry/package.json @@ -7,9 +7,11 @@ "compile": "forge compile", "deploy": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy && node script/generateTsAbis.js", "deploy:verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/Deploy.s.sol --rpc-url ${1:-default_network} --broadcast --legacy --verify ; node script/generateTsAbis.js", + "flatten": "forge flatten", "fork": "anvil --fork-url ${0:-mainnet} --chain-id 31337 --config-out localhost.json", + "format": "forge fmt && prettier --write ./script/**/*.js", "generate": "node script/generateAccount.js", - "lint": "forge fmt", + "lint": "forge fmt --check && prettier --check ./script/**/*.js", "test": "forge test", "verify": "forge build --build-info --build-info-path out/build-info/ && forge script script/VerifyAll.s.sol --ffi --rpc-url ${1:-default_network}" }, diff --git a/packages/foundry/script/DeployHelpers.s.sol b/packages/foundry/script/DeployHelpers.s.sol index 824d007..b7d6620 100644 --- a/packages/foundry/script/DeployHelpers.s.sol +++ b/packages/foundry/script/DeployHelpers.s.sol @@ -45,9 +45,7 @@ contract ScaffoldETHDeploy is Script { for (uint256 i = 0; i < len; i++) { vm.serializeString( - jsonWrite, - vm.toString(deployments[i].addr), - deployments[i].name + jsonWrite, vm.toString(deployments[i].addr), deployments[i].name ); } diff --git a/packages/foundry/script/VerifyAll.s.sol b/packages/foundry/script/VerifyAll.s.sol index 7e86628..9990f9c 100644 --- a/packages/foundry/script/VerifyAll.s.sol +++ b/packages/foundry/script/VerifyAll.s.sol @@ -10,7 +10,6 @@ import "solidity-bytes-utils/BytesLib.sol"; * @notice calls the tryffi function on the Vm contract * @notice will be deleted once the forge/std is updated */ - struct FfiResult { int32 exit_code; bytes stdout; @@ -43,8 +42,7 @@ contract VerifyAll is Script { function _verifyIfContractDeployment(string memory content) internal { string memory txType = abi.decode( vm.parseJson( - content, - searchStr(currTransactionIdx, "transactionType") + content, searchStr(currTransactionIdx, "transactionType") ), (string) ); @@ -55,31 +53,23 @@ contract VerifyAll is Script { function _verifyContract(string memory content) internal { string memory contractName = abi.decode( - vm.parseJson( - content, - searchStr(currTransactionIdx, "contractName") - ), + vm.parseJson(content, searchStr(currTransactionIdx, "contractName")), (string) ); address contractAddr = abi.decode( vm.parseJson( - content, - searchStr(currTransactionIdx, "contractAddress") + content, searchStr(currTransactionIdx, "contractAddress") ), (address) ); bytes memory deployedBytecode = abi.decode( vm.parseJson( - content, - searchStr(currTransactionIdx, "transaction.data") + content, searchStr(currTransactionIdx, "transaction.data") ), (bytes) ); bytes memory compiledBytecode = abi.decode( - vm.parseJson( - _getCompiledBytecode(contractName), - ".bytecode.object" - ), + vm.parseJson(_getCompiledBytecode(contractName), ".bytecode.object"), (bytes) ); bytes memory constructorArgs = BytesLib.slice( @@ -115,9 +105,11 @@ contract VerifyAll is Script { return; } - function nextTransaction( - string memory content - ) external view returns (bool) { + function nextTransaction(string memory content) + external + view + returns (bool) + { try this.getTransactionFromRaw(content, currTransactionIdx) { return true; } catch { @@ -125,17 +117,14 @@ contract VerifyAll is Script { } } - function _getCompiledBytecode( - string memory contractName - ) internal view returns (string memory compiledBytecode) { + function _getCompiledBytecode(string memory contractName) + internal + view + returns (string memory compiledBytecode) + { string memory root = vm.projectRoot(); string memory path = string.concat( - root, - "/out/", - contractName, - ".sol/", - contractName, - ".json" + root, "/out/", contractName, ".sol/", contractName, ".json" ); compiledBytecode = vm.readFile(path); } @@ -154,4 +143,4 @@ contract VerifyAll is Script { return string.concat(".transactions[", vm.toString(idx), "].", searchKey); } -} \ No newline at end of file +} diff --git a/packages/foundry/script/generateTsAbis.js b/packages/foundry/script/generateTsAbis.js index 562acf7..699c914 100644 --- a/packages/foundry/script/generateTsAbis.js +++ b/packages/foundry/script/generateTsAbis.js @@ -36,7 +36,7 @@ function getArtifactOfContract(contractName) { function getInheritedFromContracts(artifact) { let inheritedFromContracts = []; - if (artifact.ast) { + if (artifact?.ast) { for (const astNode of artifact.ast.nodes) { if (astNode.nodeType == "ContractDefinition") { if (astNode.baseContracts.length > 0) { @@ -47,7 +47,6 @@ function getInheritedFromContracts(artifact) { } } } - return inheritedFromContracts; } diff --git a/packages/nextjs/.gitignore b/packages/nextjs/.gitignore index 6985d55..394202c 100644 --- a/packages/nextjs/.gitignore +++ b/packages/nextjs/.gitignore @@ -11,6 +11,7 @@ # next.js /.next/ /out/ +.vercel # production /build @@ -26,13 +27,11 @@ yarn-error.log* .pnpm-debug.log* # local env files +.env .env.local .env.development.local .env.test.local .env.production.local -# vercel -.vercel - # typescript *.tsbuildinfo \ No newline at end of file diff --git a/packages/nextjs/app/blockexplorer/_components/AddressCodeTab.tsx b/packages/nextjs/app/blockexplorer/_components/AddressCodeTab.tsx index ff57c43..ee74741 100644 --- a/packages/nextjs/app/blockexplorer/_components/AddressCodeTab.tsx +++ b/packages/nextjs/app/blockexplorer/_components/AddressCodeTab.tsx @@ -4,7 +4,9 @@ type AddressCodeTabProps = { }; export const AddressCodeTab = ({ bytecode, assembly }: AddressCodeTabProps) => { - const formattedAssembly = assembly.split(" ").join("\n"); + const formattedAssembly = Array.from(assembly.matchAll(/\w+( 0x[a-fA-F0-9]+)?/g)) + .map(it => it[0]) + .join("\n"); return (
diff --git a/packages/nextjs/app/blockexplorer/_components/SearchBar.tsx b/packages/nextjs/app/blockexplorer/_components/SearchBar.tsx index 82b8839..e602096 100644 --- a/packages/nextjs/app/blockexplorer/_components/SearchBar.tsx +++ b/packages/nextjs/app/blockexplorer/_components/SearchBar.tsx @@ -16,7 +16,7 @@ export const SearchBar = () => { event.preventDefault(); if (isHex(searchInput)) { try { - const tx = await client.getTransaction({ hash: searchInput }); + const tx = await client?.getTransaction({ hash: searchInput }); if (tx) { router.push(`/blockexplorer/transaction/${searchInput}`); return; diff --git a/packages/nextjs/app/blockexplorer/address/[address]/page.tsx b/packages/nextjs/app/blockexplorer/address/[address]/page.tsx index 2f8dc26..3601da4 100644 --- a/packages/nextjs/app/blockexplorer/address/[address]/page.tsx +++ b/packages/nextjs/app/blockexplorer/address/[address]/page.tsx @@ -3,6 +3,7 @@ import path from "path"; import { foundry } from "viem/chains"; import { AddressComponent } from "~~/app/blockexplorer/_components/AddressComponent"; import deployedContracts from "~~/contracts/deployedContracts"; +import { isZeroAddress } from "~~/utils/scaffold-eth/common"; import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; type PageProps = { @@ -60,7 +61,7 @@ const getContractData = async (address: string) => { const deployedContractsOnChain = contracts ? contracts[chainId] : {}; for (const [contractName, contractInfo] of Object.entries(deployedContractsOnChain)) { - if (contractInfo.address.toLowerCase() === address) { + if (contractInfo.address.toLowerCase() === address.toLowerCase()) { contractPath = `contracts/${contractName}.sol`; break; } @@ -76,8 +77,16 @@ const getContractData = async (address: string) => { return { bytecode, assembly }; }; +export function generateStaticParams() { + // An workaround to enable static exports in Next.js, generating single dummy page. + return [{ address: "0x0000000000000000000000000000000000000000" }]; +} + const AddressPage = async ({ params }: PageProps) => { const address = params?.address as string; + + if (isZeroAddress(address)) return null; + const contractData: { bytecode: string; assembly: string } | null = await getContractData(address); return ; }; diff --git a/packages/nextjs/app/blockexplorer/page.tsx b/packages/nextjs/app/blockexplorer/page.tsx index 80f481c..61e6fc6 100644 --- a/packages/nextjs/app/blockexplorer/page.tsx +++ b/packages/nextjs/app/blockexplorer/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { PaginationButton, SearchBar, TransactionsTable } from "./_components"; import type { NextPage } from "next"; import { hardhat } from "viem/chains"; @@ -11,24 +11,23 @@ import { notification } from "~~/utils/scaffold-eth"; const BlockExplorer: NextPage = () => { const { blocks, transactionReceipts, currentPage, totalBlocks, setCurrentPage, error } = useFetchBlocks(); const { targetNetwork } = useTargetNetwork(); + const [isLocalNetwork, setIsLocalNetwork] = useState(true); + const [hasError, setHasError] = useState(false); + + useEffect(() => { + if (targetNetwork.id !== hardhat.id) { + setIsLocalNetwork(false); + } + }, [targetNetwork.id]); useEffect(() => { if (targetNetwork.id === hardhat.id && error) { - notification.error( - <> -

Cannot connect to local provider

-

- - Did you forget to run yarn chain ? -

-

- - Or you can change targetNetwork in{" "} - scaffold.config.ts -

- , - ); + setHasError(true); } + }, [targetNetwork.id, error]); - if (targetNetwork.id !== hardhat.id) { + useEffect(() => { + if (!isLocalNetwork) { notification.error( <>

@@ -48,7 +47,29 @@ const BlockExplorer: NextPage = () => { , ); } - }, [error, targetNetwork]); + }, [ + isLocalNetwork, + targetNetwork.blockExplorers?.default.name, + targetNetwork.blockExplorers?.default.url, + targetNetwork.name, + ]); + + useEffect(() => { + if (hasError) { + notification.error( + <> +

Cannot connect to local provider

+

+ - Did you forget to run yarn chain ? +

+

+ - Or you can change targetNetwork in{" "} + scaffold.config.ts +

+ , + ); + } + }, [hasError]); return (
diff --git a/packages/nextjs/app/blockexplorer/transaction/[txHash]/page.tsx b/packages/nextjs/app/blockexplorer/transaction/[txHash]/page.tsx index d9c45f5..3a49def 100644 --- a/packages/nextjs/app/blockexplorer/transaction/[txHash]/page.tsx +++ b/packages/nextjs/app/blockexplorer/transaction/[txHash]/page.tsx @@ -1,153 +1,22 @@ -"use client"; - -import { useEffect, useState } from "react"; -import { useRouter } from "next/navigation"; +import TransactionComp from "../_components/TransactionComp"; import type { NextPage } from "next"; -import { Hash, Transaction, TransactionReceipt, formatEther, formatUnits } from "viem"; -import { hardhat } from "viem/chains"; -import { usePublicClient } from "wagmi"; -import { Address } from "~~/components/scaffold-eth"; -import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork"; -import { decodeTransactionData, getFunctionDetails } from "~~/utils/scaffold-eth"; -import { replacer } from "~~/utils/scaffold-eth/common"; +import { Hash } from "viem"; +import { isZeroAddress } from "~~/utils/scaffold-eth/common"; type PageProps = { params: { txHash?: Hash }; }; + +export function generateStaticParams() { + // An workaround to enable static exports in Next.js, generating single dummy page. + return [{ txHash: "0x0000000000000000000000000000000000000000" }]; +} const TransactionPage: NextPage = ({ params }: PageProps) => { - const client = usePublicClient({ chainId: hardhat.id }); const txHash = params?.txHash as Hash; - const router = useRouter(); - const [transaction, setTransaction] = useState(); - const [receipt, setReceipt] = useState(); - const [functionCalled, setFunctionCalled] = useState(); - - const { targetNetwork } = useTargetNetwork(); - - useEffect(() => { - if (txHash) { - const fetchTransaction = async () => { - const tx = await client.getTransaction({ hash: txHash }); - const receipt = await client.getTransactionReceipt({ hash: txHash }); - - const transactionWithDecodedData = decodeTransactionData(tx); - setTransaction(transactionWithDecodedData); - setReceipt(receipt); - - const functionCalled = transactionWithDecodedData.input.substring(0, 10); - setFunctionCalled(functionCalled); - }; - fetchTransaction(); - } - }, [client, txHash]); + if (isZeroAddress(txHash)) return null; - return ( -
- - {transaction ? ( -
-

Transaction Details

{" "} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Transaction Hash: - {transaction.hash}
- Block Number: - {Number(transaction.blockNumber)}
- From: - -
-
- To: - - {!receipt?.contractAddress ? ( - transaction.to &&
- ) : ( - - Contract Creation: -
- - )} -
- Value: - - {formatEther(transaction.value)} {targetNetwork.nativeCurrency.symbol} -
- Function called: - -
- {functionCalled === "0x" ? ( - "This transaction did not call any function." - ) : ( - <> - {getFunctionDetails(transaction)} - {functionCalled} - - )} -
-
- Gas Price: - {formatUnits(transaction.gasPrice || 0n, 9)} Gwei
- Data: - -