fix(contracts): deploy with broadcast flag (#13)

* fix(contracts): deploy with broadcast flag

* fix: lint
This commit is contained in:
Aaryamann Challani
2024-07-03 13:36:43 +05:30
committed by GitHub
parent bf223ed7ff
commit f423e1b574
4 changed files with 11 additions and 10 deletions

6
.gitignore vendored
View File

@@ -31,8 +31,8 @@ lcov.info
yarn.lock
# broadcasts
!broadcast
broadcast/*
broadcast/*/31337/
contracts/!broadcast
contracts/broadcast/*
contracts/broadcast/*/31337/
.certora_internal

View File

@@ -19,7 +19,7 @@ ANVIL_PORT=8545
start:
docker compose up -d
until cast chain-id --rpc-url "http://localhost:${ANVIL_PORT}" 2> /dev/null; do sleep 1; done
cd contracts && forge script --rpc-url "http://localhost:${ANVIL_PORT}" script/Deploy.s.sol:Deploy --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
cd contracts && forge script --broadcast --rpc-url "http://localhost:${ANVIL_PORT}" script/Deploy.s.sol:Deploy --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
stop:
docker compose down

View File

@@ -1,5 +1,6 @@
ScKeystoreTest:test__addUser__addsUser__whenUserInfoIsValid() (gas: 56777)
ScKeystoreTest:test__addUser__reverts__whenUserAlreadyExists() (gas: 61532)
ScKeystoreTest:test__addUser__reverts__whenUserInfoIsMalformed() (gas: 9384)
ScKeystoreTest:test__getUser__returnsUserInfo__whenUserExists() (gas: 60956)
ScKeystoreTest:test__userExists__returnsFalse__whenUserDoesNotExist() (gas: 7976)
ScKeystoreTest:test__addUser__addsUser__whenUserInfoIsValid() (gas: 106200)
ScKeystoreTest:test__addUser__reverts__whenUserAlreadyExists() (gas: 110242)
ScKeystoreTest:test__addUser__reverts__whenUserInfoIsMalformed() (gas: 8989)
ScKeystoreTest:test__getAllKeyPackagesForUser__returnsKeyPackages__whenUserExists() (gas: 111031)
ScKeystoreTest:test__getUser__returnsUserInfo__whenUserExists() (gas: 108923)
ScKeystoreTest:test__userExists__returnsFalse__whenUserDoesNotExist() (gas: 7863)

View File

@@ -6,7 +6,7 @@ import { BaseScript } from "./Base.s.sol";
import { DeploymentConfig } from "./DeploymentConfig.s.sol";
contract Deploy is BaseScript {
function run() public returns (ScKeystore scKeystore, DeploymentConfig deploymentConfig) {
function run() public broadcast returns (ScKeystore scKeystore, DeploymentConfig deploymentConfig) {
deploymentConfig = new DeploymentConfig(broadcaster);
scKeystore = new ScKeystore();
}