-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup imports, accounts, and align versions
- Loading branch information
1 parent
55d967d
commit 659b7e3
Showing
21 changed files
with
121 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "lib/nexus"] | ||
path = lib/nexus | ||
url = https://github.com/bcnmy/nexus | ||
[submodule "lib/nexus.git"] | ||
path = lib/nexus.git | ||
url = https://github.com/bcnmy/nexus.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pragma solidity ^0.8.24; | ||
pragma solidity ^0.8.26; | ||
|
||
import "@biconomy-devx/erc7579-msa/test/foundry/mocks/MockValidator.sol"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.24; | ||
pragma solidity >=0.8.26; | ||
|
||
/** | ||
* @title Foo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.24; | ||
pragma solidity ^0.8.26; | ||
|
||
/** | ||
* @title Lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nexus
deleted from
ab9616
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
// SPDX-License-Identifier: Unlicensed | ||
pragma solidity ^0.8.24; | ||
import { BiconomySponsorshipPaymaster } from "../../contracts/sponsorship/SponsorshipPaymasterWithPremium.sol"; | ||
pragma solidity ^0.8.26; | ||
|
||
import { Test } from "forge-std/src/Test.sol"; | ||
import { StdCheats } from "forge-std/src/StdCheats.sol"; | ||
import { Vm } from "forge-std/src/Vm.sol"; | ||
|
||
import { BiconomySponsorshipPaymaster } from "../../contracts/sponsorship/SponsorshipPaymasterWithPremium.sol"; | ||
import { NexusTestBase } from "./base/NexusTestBase.sol"; | ||
|
||
contract SponsorshipPaymasterWithPremiumTest is NexusTestBase { | ||
function setUp() public virtual override { | ||
super.setUp(); | ||
|
||
contract SponsorshipPaymasterWithPremiumTest is Test { | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.26; | ||
|
||
import { Test } from "forge-std/src/Test.sol"; | ||
|
||
import { EntryPoint } from "account-abstraction/contracts/core/EntryPoint.sol"; | ||
import { Nexus } from "@nexus/contracts/Nexus.sol"; | ||
import { NexusAccountFactory } from "@nexus/contracts/factory/NexusAccountFactory.sol"; | ||
|
||
abstract contract NexusTestBase is Test { | ||
// Test Environment Configuration | ||
string constant mnemonic = "test test test test test test test test test test test junk"; | ||
uint256 constant testAccountCount = 10; | ||
uint256 constant initialMainAccountFunds = 100_000 ether; | ||
uint256 constant defaultPreVerificationGas = 21_000; | ||
|
||
uint32 nextKeyIndex; | ||
|
||
// Test Accounts | ||
struct TestAccount { | ||
address payable addr; | ||
uint256 privateKey; | ||
} | ||
|
||
TestAccount[] testAccounts; | ||
TestAccount alice; | ||
TestAccount bob; | ||
TestAccount charlie; | ||
TestAccount dan; | ||
TestAccount emma; | ||
TestAccount frank; | ||
TestAccount george; | ||
TestAccount henry; | ||
TestAccount ida; | ||
|
||
TestAccount owner; | ||
|
||
// ERC7579 Contracts | ||
EntryPoint entryPoint; | ||
Nexus saImplementation; | ||
NexusAccountFactory factory; | ||
|
||
function getNextPrivateKey() internal returns (uint256) { | ||
return vm.deriveKey(mnemonic, ++nextKeyIndex); | ||
} | ||
|
||
function setUp() public virtual { | ||
// Generate Test Addresses | ||
for (uint256 i = 0; i < testAccountCount; i++) { | ||
uint256 privateKey = getNextPrivateKey(); | ||
testAccounts.push(TestAccount(payable(vm.addr(privateKey)), privateKey)); | ||
|
||
deal(testAccounts[i].addr, initialMainAccountFunds); | ||
} | ||
|
||
// Name Test Addresses | ||
alice = testAccounts[0]; | ||
vm.label(alice.addr, string.concat("Alice", vm.toString(uint256(0)))); | ||
|
||
bob = testAccounts[1]; | ||
vm.label(bob.addr, string.concat("Bob", vm.toString(uint256(1)))); | ||
|
||
charlie = testAccounts[2]; | ||
vm.label(charlie.addr, string.concat("Charlie", vm.toString(uint256(2)))); | ||
|
||
dan = testAccounts[3]; | ||
vm.label(dan.addr, string.concat("Dan", vm.toString(uint256(3)))); | ||
|
||
emma = testAccounts[4]; | ||
vm.label(emma.addr, string.concat("Emma", vm.toString(uint256(4)))); | ||
|
||
frank = testAccounts[5]; | ||
vm.label(frank.addr, string.concat("Frank", vm.toString(uint256(5)))); | ||
|
||
george = testAccounts[6]; | ||
vm.label(george.addr, string.concat("George", vm.toString(uint256(6)))); | ||
|
||
henry = testAccounts[7]; | ||
vm.label(henry.addr, string.concat("Henry", vm.toString(uint256(7)))); | ||
|
||
ida = testAccounts[7]; | ||
vm.label(ida.addr, string.concat("Ida", vm.toString(uint256(8)))); | ||
|
||
// Name Owner | ||
owner = testAccounts[8]; | ||
vm.label(owner.addr, string.concat("Owner", vm.toString(uint256(9)))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters