Skip to content

Commit

Permalink
chore: remove dependency on pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 committed Sep 25, 2024
1 parent 4c467c7 commit 4f8418f
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 58 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- 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
Expand All @@ -41,9 +38,6 @@ jobs:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- 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
Expand All @@ -58,9 +52,6 @@ jobs:
# - uses: actions/checkout@v4
# - name: Run sccache-cache
# uses: mozilla-actions/[email protected]
# - 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
Expand All @@ -78,9 +69,6 @@ jobs:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- 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
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ To contribute to this project, ensure you have the following dependencies instal
- `make`
- `just`
- `npm`
- `pnpm`
- `yarn`

### Setup
Expand Down
27 changes: 0 additions & 27 deletions crates/yttrium/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion crates/yttrium/safe7579
Submodule safe7579 deleted from 144eb3
59 changes: 46 additions & 13 deletions crates/yttrium/src/smart_accounts/safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 4f8418f

Please sign in to comment.