-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contracts): numerous improvements to deploy scripts (+). (#1108)
- Loading branch information
Showing
39 changed files
with
689 additions
and
1,559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ jobs: | |
- name: NPM Audit | ||
run: | | ||
cd contracts | ||
pnpm audit | ||
pnpm audit --audit-level=moderate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,8 +52,11 @@ jobs: | |
- name: Force an ordinary npm install | ||
run: cd contracts && rm -rf node_modules && npm install | ||
|
||
- name: Print Aderyn version | ||
run: aderyn --version | ||
|
||
- name: Run aderyn | ||
run: aderyn ./ -o report.json | ||
run: cd contracts && aderyn ./ -o report.json | ||
|
||
- name: Check results | ||
run: cd contracts && ./tools/check_aderyn.sh | ||
|
@@ -78,17 +81,3 @@ jobs: | |
run: cd contracts && pnpm exec prettier --check 'contracts/**/*.sol' 'test/*.sol' | ||
- name: Solhint check | ||
run: cd contracts && pnpm exec solhint 'contracts/**/*.sol' | ||
|
||
codespell: | ||
name: Codespell check | ||
runs-on: ubuntu-latest | ||
if: ${{ !github.event.pull_request.draft }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: CodeSpell check | ||
uses: codespell-project/[email protected] | ||
with: | ||
check_hidden: true | ||
check_filenames: true | ||
path: contracts/contracts/*,contracts/script/*,contracts/scripts/*,contracts/test/* | ||
ignore_words_file: contracts/.codespellignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { extendProvider } from 'hardhat/config' | ||
import '@nomiclabs/hardhat-ethers' | ||
|
||
const emptyBlock = { | ||
number: '0x0', | ||
hash: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
mixHash: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
nonce: '0x0000000000000000', | ||
sha3Uncles: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
logsBloom: '0x' + '00'.repeat(256), | ||
transactionsRoot: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
stateRoot: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
receiptsRoot: '0x0000000000000000000000000000000000000000000000000000000000000000', | ||
miner: '0x0000000000000000000000000000000000000000', | ||
difficulty: '0x0', | ||
totalDifficulty: '0x0', | ||
extraData: '0x', | ||
size: '0x0', | ||
gasLimit: '0x0', | ||
gasUsed: '0x0', | ||
timestamp: '0x0', | ||
transactions: [], | ||
uncles: [], | ||
} | ||
|
||
extendProvider((provider) => { | ||
const interceptedRpcMethods = ['eth_getBlockByNumber', 'eth_getBlockByHash'] | ||
|
||
const originalProvider = provider.request.bind(provider) | ||
provider.request = async (args) => { | ||
try { | ||
return await originalProvider(args) | ||
} catch (err) { | ||
if ( | ||
interceptedRpcMethods.includes(args.method) && | ||
err.message.includes('requested epoch was a null round') | ||
) { | ||
console.warn(`[${args.method}] null round hit, returning empty block`) | ||
return emptyBlock | ||
} | ||
console.log(`Rethrowing error ${err}`) | ||
throw err | ||
} | ||
} | ||
|
||
return provider | ||
}) |
Oops, something went wrong.