diff --git a/.github/workflows/foundry.yml b/.github/workflows/foundry.yml index af7d1a6a..96d18a64 100644 --- a/.github/workflows/foundry.yml +++ b/.github/workflows/foundry.yml @@ -43,6 +43,8 @@ jobs: - name: Run Forge tests working-directory: contracts + env: + ETHEREUM_PROVIDER: "${{ secrets.ETHEREUM_PROVIDER }}" run: | - forge test -f "${{ secrets.ETHEREUM_PROVIDER }}" -vvv + forge test -vvv id: test diff --git a/contracts/scripts/DeployDevnet.s.sol b/contracts/scripts/DeployDevnet.s.sol index 401465a8..b261f4e9 100644 --- a/contracts/scripts/DeployDevnet.s.sol +++ b/contracts/scripts/DeployDevnet.s.sol @@ -44,7 +44,6 @@ contract DeployDevnet is Script { address batchInsertionVerifiers = address(0); address batchDeletionVerifiers = address(0); - function run() public { console.log( "Deploying: EntryPoint, PBHEntryPoint, PBHEntryPointImplV1, PBHSignatureAggregator, WorldIDRouter, WorldIDOrb" @@ -77,7 +76,8 @@ contract DeployDevnet is Script { pbhEntryPointImpl = address(new PBHEntryPointImplV1()); console.log("PBHEntryPointImplV1 Deployed at: ", pbhEntryPointImpl); bytes memory initCallData = abi.encodeCall( - PBHEntryPointImplV1.initialize, (IWorldID(worldIdGroups), IEntryPoint(entryPoint), 30, address(0x123), MAX_PBH_GAS_LIMIT) + PBHEntryPointImplV1.initialize, + (IWorldID(worldIdGroups), IEntryPoint(entryPoint), 30, address(0x123), MAX_PBH_GAS_LIMIT) ); pbhEntryPoint = address(new PBHEntryPoint(pbhEntryPointImpl, initCallData)); console.log("PBHEntryPoint Deployed at: ", pbhEntryPoint); diff --git a/contracts/src/PBHEntryPointImplV1.sol b/contracts/src/PBHEntryPointImplV1.sol index 47c566dc..d2ac98c1 100644 --- a/contracts/src/PBHEntryPointImplV1.sol +++ b/contracts/src/PBHEntryPointImplV1.sol @@ -123,7 +123,7 @@ contract PBHEntryPointImplV1 is IPBHEntryPoint, WorldIDImpl, ReentrancyGuard { /// @notice Initializes the contract. /// @dev Must be called exactly once. /// @dev This is marked `reinitializer()` to allow for updated initialisation steps when working - /// with upgrades based upon this contract. Be aware that there are only 256 (zero-indexed) + /// with upgrades based upon this contract. Be aware that there are only 255 (parameter is `uint8` and first value is 1) /// initialisations allowed, so decide carefully when to use them. Many cases can safely be /// replaced by use of setters. /// @dev This function is explicitly not virtual as it does not make sense to override even when @@ -281,10 +281,6 @@ contract PBHEntryPointImplV1 is IPBHEntryPoint, WorldIDImpl, ReentrancyGuard { /// @notice Sets the World ID instance that will be used for verifying proofs. /// @param _worldId The World ID instance that will be used for verifying proofs. function setWorldId(address _worldId) external virtual onlyProxy onlyInitialized onlyOwner { - if (_worldId == address(0)) { - revert AddressZero(); - } - worldId = IWorldID(_worldId); emit WorldIdSet(_worldId); } diff --git a/contracts/test/TestSetup.sol b/contracts/test/TestSetup.sol index 9d5acd6c..3ba96416 100644 --- a/contracts/test/TestSetup.sol +++ b/contracts/test/TestSetup.sol @@ -33,6 +33,8 @@ contract TestSetup is Test { /// TEST DATA /// /////////////////////////////////////////////////////////////////////////////// + string internal constant MAINNET_RPC_URL = "https://eth.llamarpc.com"; + /// @notice The 4337 Entry Point on Ethereum Mainnet. IEntryPoint internal entryPoint = IEntryPoint(address(0x0000000071727De22E5E9d8BAf0edAc6f37da032)); /// @notice The PBHEntryPoint contract. @@ -72,6 +74,10 @@ contract TestSetup is Test { /// @notice This function runs before every single test. /// @dev It is run before every single iteration of a property-based fuzzing test. function setUp() public virtual { + string memory rpcUrl = vm.envOr("ETHEREUM_PROVIDER", MAINNET_RPC_URL); + uint256 forkId = vm.createFork(rpcUrl); + vm.selectFork(forkId); + safeOwner = vm.addr(safeOwnerKey); vm.startPrank(OWNER); deployWorldIDGroups();