diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca58a333..3ec5738e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,6 @@ jobs: - uses: actions/checkout@v4 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - run: rustup update stable && rustup default stable - run: rustup toolchain install nightly -c rustfmt - run: git submodule update --init --recursive @@ -41,9 +38,6 @@ jobs: - uses: actions/checkout@v4 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - run: rustup update stable && rustup default stable - run: rustup toolchain install nightly -c rustfmt - run: git submodule update --init --recursive @@ -58,9 +52,6 @@ jobs: # - uses: actions/checkout@v4 # - name: Run sccache-cache # uses: mozilla-actions/sccache-action@v0.0.4 - # - uses: pnpm/action-setup@v4 - # with: - # version: 9 # - run: rustup update stable && rustup default stable # - run: rustup target add wasm32-unknown-unknown # - run: git submodule update --init --recursive @@ -78,9 +69,6 @@ jobs: - uses: actions/checkout@v4 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.4 - - uses: pnpm/action-setup@v4 - with: - version: 9 - run: rustup update stable && rustup default stable - run: git submodule update --init --recursive - run: make setup-thirdparty diff --git a/.gitmodules b/.gitmodules index 56f54a66..9c1ba801 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,6 @@ [submodule "crates/yttrium/safe-modules"] path = crates/yttrium/safe-modules url = https://github.com/safe-global/safe-modules -[submodule "crates/yttrium/safe7579"] - path = crates/yttrium/safe7579 - url = https://github.com/rhinestonewtf/safe7579 [submodule "test/scripts/forked_state/mock-aa-environment"] path = test/scripts/forked_state/mock-aa-environment url = https://github.com/WalletConnect/mock-aa-environment.git diff --git a/Makefile b/Makefile index 010ac529..3cbb56fe 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,6 @@ fetch-thirdparty: setup-thirdparty: cd crates/yttrium/src/contracts/ && yarn install --frozen-lockfile --immutable && yarn compile cd crates/yttrium/safe-smart-account/ && npm install - cd crates/yttrium/safe-modules/ && pnpm install build-ios-bindings: sh crates/ffi/build-rust-ios.sh diff --git a/README.md b/README.md index 79709f6b..a5297e82 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,6 @@ To contribute to this project, ensure you have the following dependencies instal - `make` - `just` - `npm` -- `pnpm` - `yarn` ### Setup diff --git a/crates/yttrium/build.rs b/crates/yttrium/build.rs index d56f7e4b..5a632633 100644 --- a/crates/yttrium/build.rs +++ b/crates/yttrium/build.rs @@ -15,33 +15,6 @@ fn build_contracts() { "safe-modules/modules/4337/contracts/SafeModuleSetup.sol", ); - { - println!("cargo::rerun-if-changed=safe7579/pnpm-lock.yaml"); - let output = Command::new("pnpm") - .current_dir("safe7579") - .args(["install"]) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn() - .unwrap() - .wait_with_output() - .unwrap(); - println!("`pnpm install` status: {:?}", output.status); - let stdout = String::from_utf8(output.stdout).unwrap(); - println!("`pnpm install` stdout: {stdout:?}"); - let stderr = String::from_utf8(output.stderr).unwrap(); - println!("`pnpm install` stderr: {stderr:?}"); - assert!(output.status.success()); - } - compile_contracts_with_args( - "safe7579/src/Safe7579Launchpad.sol", - &["--config-path=safe7579/foundry.toml".to_owned()], - ); - compile_contracts_with_args( - "safe7579/src/Safe7579.sol", - &["--config-path=safe7579/foundry.toml".to_owned()], - ); - { println!("cargo::rerun-if-changed=src/contracts/yarn.lock"); let output = Command::new("yarn") diff --git a/crates/yttrium/safe7579 b/crates/yttrium/safe7579 deleted file mode 160000 index 144eb335..00000000 --- a/crates/yttrium/safe7579 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 144eb335f65997b6ac701e6390a274b3ca31c031 diff --git a/crates/yttrium/src/smart_accounts/safe.rs b/crates/yttrium/src/smart_accounts/safe.rs index 345f3029..9e329d94 100644 --- a/crates/yttrium/src/smart_accounts/safe.rs +++ b/crates/yttrium/src/smart_accounts/safe.rs @@ -25,20 +25,53 @@ sol!( ".foundry/forge/out/Safe.sol/Safe.json" ); -sol!( - #[allow(clippy::too_many_arguments)] - #[allow(missing_docs)] - #[sol(rpc)] - Safe7579Launchpad, - ".foundry/forge/out/Safe7579Launchpad.sol/Safe7579Launchpad.json" -); +sol! { + contract Safe7579Launchpad { + struct ModuleInit { + address module; + bytes initData; + } + + struct InitData { + address singleton; + address[] owners; + uint256 threshold; + address setupTo; + bytes setupData; + address safe7579; + ModuleInit[] validators; + bytes callData; + } + + function initSafe7579( + address safe7579, + ModuleInit[] calldata executors, + ModuleInit[] calldata fallbacks, + ModuleInit[] calldata hooks, + address[] calldata attesters, + uint8 threshold + ); -sol!( - #[allow(missing_docs)] - #[sol(rpc)] - Safe7579, - ".foundry/forge/out/Safe7579.sol/Safe7579.json" -); + function setupSafe(InitData calldata initData); + + function preValidationSetup( + bytes32 initHash, + address to, + bytes calldata preInit + ); + } +} + +sol! { + contract Safe7579 { + type ModeCode is bytes32; + + function execute( + ModeCode mode, + bytes calldata executionCalldata + ); + } +} // https://github.com/WalletConnect/secure-web3modal/blob/f1d16f973a313e598d124a0e4751aee12d5de628/src/core/SmartAccountSdk/utils.ts#L180 pub const SAFE_ERC_7579_LAUNCHPAD_ADDRESS: Address =