Skip to content

Commit

Permalink
test: mainnet test skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
antoncoding committed Oct 25, 2023
1 parent 5cd46de commit 482a23b
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 508 deletions.
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ libs = ["lib"]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options

[rpc_endpoints]
mainnet = "https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}"
op_goerli = "https://endpoints.omniatech.io/v1/op/goerli/public"
20 changes: 19 additions & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,17 @@ contract Deploy is Script {
config.socketVault
);

LyraSelfPayingForwarder selfPayingForwarder = new LyraSelfPayingForwarder(
config.usdcLocal,
config.usdcRemote,
config.bridge,
config.socketVault
);

console2.log("LyraSponsoredForwarder deployed at: ", address(sponsoredForwarder));

console2.log("LyraSelfPayingForwarder deployed at: ", address(selfPayingForwarder));

vm.stopBroadcast();
}

Expand All @@ -47,9 +56,18 @@ contract Deploy is Script {
trustedForwarder: 0xd8253782c45a12053594b9deB72d8e8aB2Fca54c,
usdcLocal: 0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6, // official USDC op goerli
usdcRemote: 0x0000000000000000000000000000000000000000, //
bridge: 0x0000000000000000000000000000000000000000, // no standard bridge on goerli
bridge: 0x0000000000000000000000000000000000000000,
// no standard bridge on goerli
socketVault: 0x0000000000000000000000000000000000000000 // todo: add socket vault
});
} else if (block.chainid == 1) {
return DeploymentConfig({
trustedForwarder: 0x3CACa7b48D0573D793d3b0279b5F0029180E83b6,
usdcLocal: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, // mainnet USDC
usdcRemote: 0x7F5c764cBc14f9669B88837ca1490cCa17c31607, // OP USDC (Bridged)
bridge: 0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1, // OP bridge on mainnet
socketVault: 0x0000000000000000000000000000000000000000
});
}

revert("Need config set! Please set config in script/Deploy.s.sol");
Expand Down
2 changes: 1 addition & 1 deletion src/gelato/LyraForwarderBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract contract LyraForwarderBase {
usdcSocketVault = _socketVault;

IERC20(_usdcLocal).approve(_l1standardBridge, type(uint256).max);
IERC20(_usdcLocal).approve(_socketVault, type(uint256).max);
if (_socketVault != address(0)) IERC20(_usdcLocal).approve(_socketVault, type(uint256).max);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/gelato/LyraSelfPayingForwarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {LyraForwarderBase} from "./LyraForwarderBase.sol";
/**
* @title LyraSelfPayingForwarder
* @notice Use this contract to allow gasless transactions, but users pay for their own gas with ERC20s
* @dev This contract can only be called by GELATO_RELAY_ERC2771 or GELATO_RELAY_CONCURRENT_ERC2771
*/
contract LyraSelfPayingForwarder is LyraForwarderBase, GelatoRelayContextERC2771 {
constructor(address _usdcLocal, address _usdcRemote, address _bridge, address _socketVault)
Expand Down
Loading

0 comments on commit 482a23b

Please sign in to comment.