-
Notifications
You must be signed in to change notification settings - Fork 14
Deployment Scripts via Forge & Contract docs #482
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
Conversation
…ct deployment code in the contracts dir, along with readmes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great with contract docs 💯.
LGTM, but I'll let others chime in.
contracts/script/deploy.sh
Outdated
|
||
# Use environment variables with defaults | ||
RPC_URL=${RPC_URL:-"http://localhost:8545"} | ||
ACCOUNT_INDEX=${ACCOUNT_INDEX:-0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACCOUNT_INDEX=${ACCOUNT_INDEX:-0} | |
ACCOUNT_INDEX=${ACCOUNT_INDEX:-0} | |
MNEMONIC=${MNEMONIC:-"test test test test test test test test test test test junk"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls use attend year erase basket blind adapt stove broccoli isolate unveil acquire category
as the default mnemonic,
@alysiahuggins need to fund this account
# default test wallet's private key
FAUCET_PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
# Fund the manager account
cast send --value 1ether --private-key "$FAUCET_PRIVATE_KEY" "$MANAGER_ADDRESS"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. As long as we fund the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is now in a seperate repo, this concern is no longer here (as discussed during the standup)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me! i have nothing to add here. Thanks!
should we first move this work to https://github.com/EspressoSystems/timeboost-contracts? @alysiahuggins @lukeiannucci ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @alysiahuggins, the documentation looks fine. but we already have deployment via rust binary timeboost-contract/src/binaries/deploy.rs
and we tried to avoid .env
as per Toralf's suggestion since we want to centralize our config in the config files (you can see test-configs/c0/node_0.toml
for an example instead of having both these node config files and .env
files.
i also added a bash script in scripts/test-contract-deploy
to 1) spawn anvil; 2) deploy contracts; 3) register committee (by invoking the binary register.rs
).
(special note is that for the test wallet, I didn't use test test ... junk
mnemonic phrase, as i explained here)
update: I take back my comments on avoiding .env
and forge script. ignore that comment there.
i was thinking since we already started leaving comments here, we could finish it here then port it over. but if want to move the discussion and changes there, i have no problem |
i personally like the secondary script to deploy, as we are going to be moving this |
agree. my suggestion is: continue the discussion and address all comments in the current PR.
i think i see your point. the cyclic dep issue if the nitro repo requires timeboost's binary to deploy these contract. my only concern is drifting config ( |
Co-authored-by: Anders Konring <[email protected]>
Co-authored-by: Anders Konring <[email protected]>
…tain, now it entails an overview of the crate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contract side looks good to me, @alysiahuggins you can follow #482 (comment) and migrate the changes to the new contract repo.
then can we rebase (completely rewrite the git history of this branch) and only leave changes made to timeboost-contract
and timeboost-proto
?
@lukeiannucci do you have better suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this we have multiple ways to deploy the contract, a Rust binary (deploy.rs) plus shell script and now also a forge script, shell script and .env file. My preference would be to consolidate this and have only one way to deploy, specifically I would remove deploy.rs and test-contract-deploy. Unless I am missing something the .env file and deploy.sh in here can also be removed and we can add the forge script command to the existing justfile.
contracts/script/deploy.sh
Outdated
export MANAGER_ADDRESS=$MANAGER_ADDRESS | ||
|
||
# Build forge command | ||
FORGE_CMD="forge script script/DeployKeyManager.s.sol:DeployKeyManager --rpc-url $RPC_URL --broadcast --mnemonics \"$MNEMONIC\" --mnemonic-indexes $ACCOUNT_INDEX" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure why we need an .env file and deploy.sh? Can we not just run this forge
command directly, e.g. from our Justfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good q and we don't need both but the contracts directory is actually going to be moved to this new repo and it would be good to have standalone deployment scripts there (and so far that repo doesn't use a justfile)
* Port EspressoSystems/timeboost#482 into timeboost-contracts * remove redudunct readme and linked to the correct readme location for the timeboost repo * remove lock files in gitignore * improves readme
no longer needed as discussed in chat and the standup
Closes #<ISSUE_NUMBER>
This PR:
timelock-contracts
repo as a submodule (here is the sister Port EspressoSystems/timeboost#482 into timeboost-contracts timeboost-contracts#2)This PR does not:
Key places to review:
How to test this PR:
cargo test -p timeboost-contract