Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
5705ada5
Unverified
Commit
5705ada5
authored
Nov 25, 2022
by
Maurelian
Committed by
GitHub
Nov 25, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4083 from ethereum-optimism/jm/ci-echidna-job
parents
b14ac6b0
43f33f39
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
2 deletions
+80
-2
breezy-rockets-knock.md
.changeset/breezy-rockets-knock.md
+5
-0
config.yml
.circleci/config.yml
+47
-0
README.md
packages/contracts-bedrock/README.md
+11
-0
foundry.toml
packages/contracts-bedrock/foundry.toml
+3
-0
hardhat.config.ts
packages/contracts-bedrock/hardhat.config.ts
+6
-1
package.json
packages/contracts-bedrock/package.json
+8
-1
No files found.
.changeset/breezy-rockets-knock.md
0 → 100644
View file @
5705ada5
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Add echidna test commands
.circleci/config.yml
View file @
5705ada5
...
@@ -262,6 +262,50 @@ jobs:
...
@@ -262,6 +262,50 @@ jobs:
command
:
yarn storage-snapshot && git diff --exit-code .storage-layout
command
:
yarn storage-snapshot && git diff --exit-code .storage-layout
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
contracts-bedrock-echidna
:
docker
:
-
image
:
ethereumoptimism/ci-builder:latest
resource_class
:
large
steps
:
-
checkout
-
attach_workspace
:
{
at
:
"
."
}
-
run
:
name
:
Check if we should run
command
:
|
shopt -s inherit_errexit
CHANGED=$(check-changed "(contracts-bedrock/contracts)" || echo "TRUE")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
-
run
:
name
:
Compile with metadata hash
command
:
yarn build:with-metadata
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Aliasing
command
:
yarn echidna:aliasing || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Burn
command
:
yarn echidna:burn || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Encoding
command
:
yarn echidna:encoding || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Portal
command
:
yarn enchidna:portal || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Hashing
command
:
yarn echidna:hashing || exit
0
working_directory
:
packages/contracts-bedrock
-
run
:
name
:
Echidna Fuzz Resource Metering
command
:
yarn echidna:metering || exit
0
working_directory
:
packages/contracts-bedrock
op-bindings-build
:
op-bindings-build
:
docker
:
docker
:
-
image
:
ethereumoptimism/ci-builder:latest
-
image
:
ethereumoptimism/ci-builder:latest
...
@@ -775,6 +819,9 @@ workflows:
...
@@ -775,6 +819,9 @@ workflows:
-
contracts-bedrock-tests
:
-
contracts-bedrock-tests
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
-
contracts-bedrock-echidna
:
requires
:
-
yarn-monorepo
-
op-bindings-build
:
-
op-bindings-build
:
requires
:
requires
:
-
yarn-monorepo
-
yarn-monorepo
...
...
packages/contracts-bedrock/README.md
View file @
5705ada5
...
@@ -77,6 +77,17 @@ yarn build
...
@@ -77,6 +77,17 @@ yarn build
yarn
test
yarn
test
```
```
#### Running Echidna tests
You must have
[
Echidna
](
https://github.com/crytic/echidna
)
installed.
Contracts targetted for Echidna testing are located in
`./contracts/echidna`
Each target contract is tested with a separate yarn command, for example:
```
shell
yarn echidna:aliasing
```
### Deployment
### Deployment
#### Configuration
#### Configuration
...
...
packages/contracts-bedrock/foundry.toml
View file @
5705ada5
...
@@ -21,3 +21,6 @@ fuzz_runs = 16
...
@@ -21,3 +21,6 @@ fuzz_runs = 16
[profile.ci]
[profile.ci]
fuzz_runs
=
512
fuzz_runs
=
512
[profile.echidna]
bytecode_hash
=
'ipfs'
packages/contracts-bedrock/hardhat.config.ts
View file @
5705ada5
...
@@ -10,6 +10,11 @@ import 'hardhat-deploy'
...
@@ -10,6 +10,11 @@ import 'hardhat-deploy'
// Hardhat tasks
// Hardhat tasks
import
'
./tasks
'
import
'
./tasks
'
let
bytecodeHash
=
'
none
'
if
(
process
.
env
.
FOUNDRY_PROFILE
===
'
echidna
'
)
{
bytecodeHash
=
'
ipfs
'
}
const
config
:
HardhatUserConfig
=
{
const
config
:
HardhatUserConfig
=
{
networks
:
{
networks
:
{
hardhat
:
{
hardhat
:
{
...
@@ -371,7 +376,7 @@ const config: HardhatUserConfig = {
...
@@ -371,7 +376,7 @@ const config: HardhatUserConfig = {
],
],
settings
:
{
settings
:
{
metadata
:
{
metadata
:
{
bytecodeHash
:
'
none
'
,
bytecodeHash
,
},
},
outputSelection
:
{
outputSelection
:
{
'
*
'
:
{
'
*
'
:
{
...
...
packages/contracts-bedrock/package.json
View file @
5705ada5
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
],
],
"scripts"
:
{
"scripts"
:
{
"build:forge"
:
"forge build"
,
"build:forge"
:
"forge build"
,
"build:with-metadata"
:
"hardhat clean && FOUNDRY_PROFILE=echidna hardhat compile"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
...
@@ -36,7 +37,13 @@
...
@@ -36,7 +37,13 @@
"lint:contracts:fix"
:
"yarn prettier --write 'contracts/**/*.sol'"
,
"lint:contracts:fix"
:
"yarn prettier --write 'contracts/**/*.sol'"
,
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"typechain"
:
"typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'"
"typechain"
:
"typechain --target ethers-v5 --out-dir dist/types --glob 'artifacts/!(build-info)/**/+([a-zA-Z0-9_]).json'"
,
"echidna:aliasing"
:
"echidna-test --contract FuzzAddressAliasing --format text --crytic-args --hardhat-ignore-compile ."
,
"echidna:burn"
:
"echidna-test --contract FuzzBurn --format text --crytic-args --hardhat-ignore-compile ."
,
"echidna:encoding"
:
"echidna-test --contract FuzzEncoding --format text --crytic-args --hardhat-ignore-compile ."
,
"echidna:portal"
:
"echidna-test --contract FuzzOptimismPortal --format text --crytic-args --hardhat-ignore-compile ."
,
"echidna:hashing"
:
"echidna-test --contract FuzzHashing --format text --crytic-args --hardhat-ignore-compile ."
,
"echidna:metering"
:
"echidna-test --contract FuzzResourceMetering --format text --crytic-args --hardhat-ignore-compile ."
},
},
"dependencies"
:
{
"dependencies"
:
{
"@eth-optimism/core-utils"
:
"^0.11.0"
,
"@eth-optimism/core-utils"
:
"^0.11.0"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment