Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For CI, deploy to Arbitrum Sepolia instead of Base Sepolia #89

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
48e1b1c
Changed `deploy:ci` to deploy to Arbitrum Sepolia
jplodge-pro Aug 7, 2024
2863b10
Only formatted.
jplodge-pro Aug 7, 2024
63a105d
Changed the Network Id to Arbitrum Sepolia.
jplodge-pro Aug 7, 2024
aef04a0
Renamed `deploy-arbSepolia` to the full-name `deploy-arbitrumSepolia`
jplodge-pro Aug 7, 2024
7818d7d
Enabled `deploy:ci` to deploy to Arbitrum Sepolia
jplodge-pro Aug 7, 2024
f4d09ed
Upgraded solhint to 5.0.3 due to error running it.
jplodge-pro Aug 7, 2024
23acada
Added prefixed '@' to make commands to avoid outputting secret inform…
jplodge-pro Aug 8, 2024
1af018f
Enabled Github Action for this branch.
jplodge-pro Aug 8, 2024
e9d39f1
Added the ETHERSCAN_API_KEY explicitly.
jplodge-pro Aug 8, 2024
7596b20
`exporter.js` now fails as a process, on Error.
jplodge-pro Aug 8, 2024
c0830e2
Upgraded to `actions@checkoutv4`.
jplodge-pro Aug 8, 2024
6aeb841
Remove the branch from the GitHub Action triggers.
jplodge-pro Aug 8, 2024
d267f53
Specify Foundry version in Github actions. Later versions have Ether…
lucasia Aug 8, 2024
3a1a7be
Update Arbitrum Sepolia to use Blockscout verify
lucasia Aug 8, 2024
8dfd8e5
Revert "Update Arbitrum Sepolia to use Blockscout verify"
lucasia Aug 9, 2024
bae7c36
Add a trailing ? to Arbitrum Sepolia Verifier URL. Just to try!
jplodge-pro Aug 12, 2024
02ad77c
Use nightly foundry again.
jplodge-pro Aug 12, 2024
db16cd9
Revert "Use nightly foundry again."
jplodge-pro Aug 12, 2024
338daca
Added multiple Arbitrum Sepolia entries in foundry.toml.
jplodge-pro Aug 13, 2024
f428d35
Explicitly add the ETHERSCAN_API_KEY
jplodge-pro Aug 13, 2024
9da0a33
Use full cli option name.
jplodge-pro Aug 13, 2024
2fd23ce
Try to force verification.
jplodge-pro Aug 13, 2024
e721927
CHanged the main contracts to see if verification works with original…
jplodge-pro Aug 13, 2024
ec7bc67
Make them all more valid.
jplodge-pro Aug 13, 2024
c8405de
Change to nightly foundry.
jplodge-pro Aug 13, 2024
d220958
fix: F-2024-4399
Krishnakumarskr Jul 30, 2024
8c14010
fix: F-2024-4400 - only for update functions
Krishnakumarskr Jul 30, 2024
8fdc451
fix: F-2024-4403
Krishnakumarskr Jul 30, 2024
64e21b3
fixed lint warning for immutable variables
Krishnakumarskr Jul 30, 2024
b60f389
fix: F-2024-4414
Krishnakumarskr Jul 30, 2024
570cddb
fix: F-2024-4416 only for collateral percentage
Krishnakumarskr Jul 30, 2024
fe1179d
fix: F-2024-4396
Krishnakumarskr Aug 2, 2024
3b3b69f
fix: F-2024-4398
Krishnakumarskr Aug 2, 2024
57c2843
fix: F-2024-4400
Krishnakumarskr Aug 2, 2024
be52215
rename collateral to upside
Krishnakumarskr Aug 2, 2024
cebf163
pr comment fix
Krishnakumarskr Aug 6, 2024
da7574f
fix: F-2024-4414, on vault factory
Krishnakumarskr Aug 13, 2024
ec48370
Update CBL Readme to add locking to receive Governance Token ()
lucasia Aug 7, 2024
e9f3d43
Alter the code so that Arbiscan does not verify on fuzzy deployed byt…
jplodge-pro Aug 14, 2024
1f185f2
Removed the options for Arbitrum Sepolia.
jplodge-pro Aug 14, 2024
9691ef2
Reverted all deployed contract changs.
jplodge-pro Aug 14, 2024
eb0512d
Restored the use of pinned foundry version in CI/Testnet deployment.
jplodge-pro Aug 14, 2024
dce2a85
Remove the `--verifier-url` from the makefile.
jplodge-pro Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci-dev-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ jobs:
run: yarn deploy:ci
env:
ENVIRONMENT: "testnet"
DEPLOYER_PRIVATE_KEY: ${{ secrets.BASE_SEPOLIA_DEPLOYER_PRIVATE_KEY }}
DEPLOYER_PRIVATE_KEY: ${{ secrets.ARBITRUM_SEPOLIA_DEPLOYER_PRIVATE_KEY }}
ALCHEMY_API_KEY: ${{ secrets.TESTNET_ALCHEMY_API_KEY }}
BASE_SEPOLIA_ETHERSCAN_API_KEY: ${{ secrets.BASE_SEPOLIA_ETHERSCAN_API_KEY }}
ARBITRUM_SEPOLIA_ETHERSCAN_API_KEY: ${{ secrets.ARBITRUM_SEPOLIA_ETHERSCAN_API_KEY }}
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.TEST_SUPABASE_SERVICE_ROLE_KEY }}
42 changes: 21 additions & 21 deletions packages/contracts/Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# NOTE (JL,2024-05-20): Hierarchical Environment loading does not simply work with `make`. A custom
# solution may be possible, but given that `forge` auto-loads any `.env` file in the invocation
# NOTE (JL,2024-05-20): Hierarchical Environment loading does not simply work with `make`. A custom
# solution may be possible, but given that `forge` auto-loads any `.env` file in the invocation
# directory and our deployment scripts depend on this, it seems unnecessary to change this now.
-include .env

build:; forge build
DEPLOY_SCRIPT ?= script/DeployVaultFactory.s.sol:DeployVaultFactory

anvil: anvil
# How the deployer is authenticated. Can override to use `cast wallet` output or `--account x --password y` etc.
DEPLOYER_AUTHENTICATION ?= --private-key $(DEPLOYER_PRIVATE_KEY)

deploy-local:
$(MAKE) deploy RPC_URL=localhost EXTRA_FLAGS=

# TODO: change this to use the network config from foundry.toml
deploy-arbSepolia:
deploy-arbitrumSepolia:
$(MAKE) deploy RPC_URL=arbitrumSepolia EXTRA_FLAGS="--verify --slow"

resume-arbSepolia:
resume-arbitrumSepolia:
$(MAKE) deploy RPC_URL=arbitrumSepolia EXTRA_FLAGS="--verify --slow --resume"

deploy-baseSepolia:
$(MAKE) deploy RPC_URL=baseSepolia EXTRA_FLAGS="--verify --slow"

# NOTE (JL,2024-05-20): `forge` auto-includes any `.env` file in the invocation directory.
deploy:
@echo "Running deploy '$(RPC_URL)' for '$(ENVIRONMENT)' environment."
@rm -rf out && \
forge script script/DeployVaultFactory.s.sol:DeployVaultFactory --rpc-url $(RPC_URL) \
--private-key $(DEPLOYER_PRIVATE_KEY) --broadcast $(EXTRA_FLAGS) -vvvv && \
yarn gen-types && \
yarn db-export

# TODO: add --verifier flag. forge isn't happy --etherscan-api-key is empty.
deploy-bitlayerTestnet:
$(MAKE) deploy RPC_URL="https://testnet-rpc.bitlayer.org" \
EXTRA_FLAGS='--etherscan-api-key "" --verifier-url "https://testnet-scan.bitlayer.org" --legacy --slow'
EXTRA_FLAGS='--etherscan-api-key "" --verifier-url "https://testnet-scan.bitlayer.org" --legacy --slow'

# NOTE (JL,2024-05-20): `forge` auto-includes any `.env` file in the invocation directory.
deploy:
@echo "Running deploy script '$(DEPLOY_SCRIPT)' against '$(RPC_URL)' for '$(ENVIRONMENT)' environment."
@yarn clean
@yarn build
forge script $(DEPLOY_SCRIPT) --rpc-url $(RPC_URL) --chain-id $$(cast chain-id --rpc-url $(RPC_URL)) \
$(DEPLOYER_AUTHENTICATION) --broadcast $(EXTRA_FLAGS) -vvvv
yarn db-export

verify:
@echo "Running verify '$(RPC_URL)' for '$(ENVIRONMENT)' environment."
rm -rf out && \
forge script script/DeployVaultFactory.s.sol:DeployVaultFactory --rpc-url $(RPC_URL) \
--private-key $(DEPLOYER_PRIVATE_KEY) --verify --resume -vvvv && \
yarn gen-types && \
@echo "Running verify of script '$(DEPLOY_SCRIPT)' against '$(RPC_URL)' for '$(ENVIRONMENT)' environment."
@yarn clean
jplodge-pro marked this conversation as resolved.
Show resolved Hide resolved
@yarn build
forge script $(DEPLOY_SCRIPT) --rpc-url $(RPC_URL) $(DEPLOYER_AUTHENTICATION) --verify --resume -vvvv
jplodge-pro marked this conversation as resolved.
Show resolved Hide resolved
yarn db-export
10 changes: 5 additions & 5 deletions packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ src = "src"
out = "out"
libs = ["lib"]
fs_permissions = [{ access = "read-write", path = "./" }]
solc_version="0.8.23"
solc_version = "0.8.23"

[fmt]
bracket_spacing = true
Expand All @@ -25,9 +25,9 @@ bitlayerTestnet = "https://testnet-rpc.bitlayer.org"


[etherscan]
localhost = { key = "" , url="http://127.0.0.1:8545"}
localhost = { key = "", url = "http://127.0.0.1:8545" }
base = { key = "${BASE_ETHERSCAN_API_KEY}" }
baseSepolia = { key = "${BASE_SEPOLIA_ETHERSCAN_API_KEY}" }
arbitrumSepolia = { key = "${ARB_SEPOLIA_ETHERSCAN_API_KEY}", url = "https://api-sepolia.arbiscan.io/api", chain=421614 }
bitlayer = { key = "bitlayer", url="https://rpc.bitlayer.org" }
bitlayerTestnet = { key = "bitlayerTestnet", url="https://testnet-scan.bitlayer.org" }
arbitrumSepolia = { key = "${ARBITRUM_SEPOLIA_ETHERSCAN_API_KEY}", url = "https://api-sepolia.arbiscan.io/api", chain = 421614 }
bitlayer = { key = "bitlayer", url = "https://rpc.bitlayer.org" }
bitlayerTestnet = { key = "bitlayerTestnet", url = "https://testnet-scan.bitlayer.org" }
8 changes: 4 additions & 4 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"chain": "yarn rm-dbdata && anvil --config-out localhost.json",
"clean": "forge clean && rm -rf broadcast cache deployments types localhost.json index.js",
"dev": "yarn rm-dbdata && anvil --config-out localhost.json & make deploy-local",
"build": "forge build && yarn gen-types",
"build": "forge build && yarn gen-types && tsc",
"test": "forge test",
"format": "forge fmt && prettier './script/**/*.js' --write",
"lint": "forge fmt && eslint --fix --ignore-path .gitignore && yarn solhint './*(test|src)/**/*.sol'",
"db-check": "tsc && node ./script/utils/checkDb.js",
"db-export": "tsc && node ./script/utils/exporter.js",
"deploy": "make deploy-local",
"deploy:ci": "yarn db-export && make deploy-baseSepolia",
jplodge-pro marked this conversation as resolved.
Show resolved Hide resolved
"gen-types": "yarn typechain --target ethers-v5 --out-dir ./types ./out/*.sol/*.json && tsc",
jplodge-pro marked this conversation as resolved.
Show resolved Hide resolved
"deploy:ci": "make deploy-arbitrumSepolia",
"gen-types": "yarn typechain --target ethers-v5 --out-dir ./types ./out/*.sol/*.json",
"postinstall": "yarn build && yarn gen-types"
},
"packageManager": "[email protected]",
Expand All @@ -28,7 +28,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.2",
"solhint": "^5.0.1",
"solhint": "^5.0.3",
"typechain": "^8.3.2",
"typescript": "^5.4.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/resource/testnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[evm]
# blockchain id, e.g. baseSepolia=84532, arbSepolia=421614
chain_id = 84532
chain_id = 421614
deploy_mocks = true

[evm.address]
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ __metadata:
ethers: ^5.7.2
js-toml: ^1.0.0
prettier: ^3.2.2
solhint: ^5.0.1
solhint: ^5.0.3
typechain: ^8.3.2
typescript: ^5.4.5
languageName: unknown
Expand Down Expand Up @@ -15705,9 +15705,9 @@ __metadata:
languageName: node
linkType: hard

"solhint@npm:^5.0.1":
version: 5.0.1
resolution: "solhint@npm:5.0.1"
"solhint@npm:^5.0.3":
version: 5.0.3
resolution: "solhint@npm:5.0.3"
dependencies:
"@solidity-parser/parser": ^0.18.0
ajv: ^6.12.6
Expand All @@ -15733,7 +15733,7 @@ __metadata:
optional: true
bin:
solhint: solhint.js
checksum: ff961f5e3e62172b6e26cda758b4b2e266cd07fdc32f280bfbafeb9eda99177326515aaeb5dfff531eeb03c01e432488783f4406439e7524c8da1afa0235a44e
checksum: 30361c0099cded492059719e477cecadcc7390f87a1737904411e8dbf15277344a5892e0762738a025cefd78467455601db1d7d6ffb3d489a6ab6e296c6a7b92
languageName: node
linkType: hard

Expand Down