Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: EVM changes required to support Solana #672

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6b4d8bc
feat(chain-adapters): add solana adapter (#641)
Reinis-FRP Oct 18, 2024
c4153c4
Merge branch 'master' into svm-dev
chrismaree Oct 18, 2024
9201079
Merge branch 'master' into svm-dev
chrismaree Oct 18, 2024
5a54ddb
feat: address to bytes32 contract changes (#650)
md0x Oct 21, 2024
c338c54
Merge branch 'master' into svm-dev
chrismaree Oct 21, 2024
aa36eb6
feat: Add relayer repayment address (#653)
chrismaree Oct 22, 2024
1afdf1e
fix: clean up cast utilities (#676)
chrismaree Oct 22, 2024
7a85081
feat: update spokepool relayer refund to handle blocked transfers (#675)
chrismaree Oct 28, 2024
d94686d
WIP
chrismaree Nov 1, 2024
3e7cb6c
WIP
chrismaree Nov 1, 2024
18df9a0
Merge branch 'master' into svm-dev
md0x Nov 7, 2024
231b509
fix(evm): merkle tree tests bytes32
md0x Nov 7, 2024
75d1699
Merge branch 'master' into svm-dev
chrismaree Nov 9, 2024
38be8e0
WIP
chrismaree Nov 9, 2024
b223f6c
feat(svm): svm-dev fixes from review (#727)
md0x Nov 19, 2024
58b09d3
Merge branch 'master' into svm-dev
md0x Nov 20, 2024
3d0e899
test: fix forge tests
md0x Nov 20, 2024
1ff7bb1
proposal: ensure that EVM errors are always consistant on underflows …
chrismaree Nov 22, 2024
d36f9e6
feat: revert bytes32 conversion for internal functions (#755)
md0x Nov 22, 2024
848e043
WIP
chrismaree Nov 22, 2024
3c2ab40
Discard changes to contracts/Ovm_SpokePool.sol
chrismaree Nov 23, 2024
a89be73
fix: stack too deep (#766)
md0x Nov 25, 2024
656578a
WIP
chrismaree Nov 25, 2024
56dca16
WIP
chrismaree Nov 25, 2024
5c566fb
WIP
chrismaree Nov 25, 2024
f80e188
Revert "feat: update depositor to bytes32" (#764)
md0x Nov 25, 2024
740d44f
Merge branch 'master' into svm-dev
chrismaree Nov 25, 2024
c9d0837
Merge branch 'svm-dev' of github.com:across-protocol/contracts into s…
chrismaree Nov 25, 2024
79bf5b8
Discard changes to contracts/PolygonZkEVM_SpokePool.sol
chrismaree Nov 25, 2024
aa48a3d
Discard changes to contracts/Polygon_SpokePool.sol
chrismaree Nov 25, 2024
e582cb7
Merge branch 'master' into svm-dev
chrismaree Nov 25, 2024
44bfd94
fix: make event case consistant between evm & svm (#760)
chrismaree Nov 25, 2024
d1f7a3a
feat(SpokePool): Remove depositExclusive (#642)
nicholaspai Nov 25, 2024
9905481
feat: Introduce opt-in deterministic relay data hashes (again) (#639)
mrice32 Nov 25, 2024
6e18091
Merge branch 'master' into svm-dev
mrice32 Nov 25, 2024
48d65d4
docs: fix comment duplication (#775)
md0x Nov 25, 2024
0691f0a
fix: emit hashed message in evm fill events (#772)
Reinis-FRP Nov 25, 2024
9a93d49
Merge branch 'master' into svm-dev
Reinis-FRP Nov 25, 2024
0f2600f
fix: linting
Reinis-FRP Nov 25, 2024
fa137a2
feat: improve _getV3RelayHash method (#779)
chrismaree Dec 3, 2024
0396330
Merge branch 'master' into svm-dev
chrismaree Dec 3, 2024
8e8370f
WIP
chrismaree Dec 3, 2024
af4c107
WIP
chrismaree Dec 3, 2024
401e24c
Merge branch 'master' into svm-dev
chrismaree Dec 4, 2024
f890911
WIP
chrismaree Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions contracts/Linea_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
*/
contract Linea_SpokePool is SpokePool {
using SafeERC20 for IERC20;
using AddressToBytes32 for address;

/**
* @notice Address of Linea's Canonical Message Service contract on L2.
Expand Down Expand Up @@ -122,8 +123,8 @@ contract Linea_SpokePool is SpokePool {
* @notice Wraps any ETH into WETH before executing base function. This is necessary because SpokePool receives
* ETH over the canonical token bridge instead of WETH.
*/
function _preExecuteLeafHook(address l2TokenAddress) internal override {
if (l2TokenAddress == address(wrappedNativeToken)) _depositEthToWeth();
function _preExecuteLeafHook(bytes32 l2TokenAddress) internal override {
if (l2TokenAddress == address(wrappedNativeToken).toBytes32()) _depositEthToWeth();
}

// Wrap any ETH owned by this contract so we can send expected L2 token to recipient. This is necessary because
Expand Down
6 changes: 4 additions & 2 deletions contracts/Ovm_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ interface IL2ERC20Bridge {
*/
contract Ovm_SpokePool is SpokePool, CircleCCTPAdapter {
using SafeERC20 for IERC20;
using AddressToBytes32 for address;
// "l1Gas" parameter used in call to bridge tokens from this contract back to L1 via IL2ERC20Bridge. Currently
// unused by bridge but included for future compatibility.

uint32 public l1Gas;

// ETH is an ERC20 on OVM.
Expand Down Expand Up @@ -133,8 +135,8 @@ contract Ovm_SpokePool is SpokePool, CircleCCTPAdapter {
* @notice Wraps any ETH into WETH before executing leaves. This is necessary because SpokePool receives
* ETH over the canonical token bridge instead of WETH.
*/
function _preExecuteLeafHook(address l2TokenAddress) internal override {
if (l2TokenAddress == address(wrappedNativeToken)) _depositEthToWeth();
function _preExecuteLeafHook(bytes32 l2TokenAddress) internal override {
if (l2TokenAddress == address(wrappedNativeToken).toBytes32()) _depositEthToWeth();
}

// Wrap any ETH owned by this contract so we can send expected L2 token to recipient. This is necessary because
Expand Down
7 changes: 4 additions & 3 deletions contracts/PolygonZkEVM_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ interface IBridgeMessageReceiver {
*/
contract PolygonZkEVM_SpokePool is SpokePool, IBridgeMessageReceiver {
using SafeERC20 for IERC20;

using AddressToBytes32 for address;
// Address of Polygon zkEVM's Canonical Bridge on L2.

IPolygonZkEVMBridge public l2PolygonZkEVMBridge;

// Polygon zkEVM's internal network id for L1.
Expand Down Expand Up @@ -157,8 +158,8 @@ contract PolygonZkEVM_SpokePool is SpokePool, IBridgeMessageReceiver {
* @notice Wraps any ETH into WETH before executing base function. This is necessary because SpokePool receives
* ETH over the canonical token bridge instead of WETH.
*/
function _preExecuteLeafHook(address l2TokenAddress) internal override {
if (l2TokenAddress == address(wrappedNativeToken)) _depositEthToWeth();
function _preExecuteLeafHook(bytes32 l2TokenAddress) internal override {
if (l2TokenAddress == address(wrappedNativeToken).toBytes32()) _depositEthToWeth();
}

// Wrap any ETH owned by this contract so we can send expected L2 token to recipient. This is necessary because
Expand Down
7 changes: 3 additions & 4 deletions contracts/Polygon_SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ contract Polygon_SpokePool is IFxMessageProcessor, SpokePool, CircleCCTPAdapter
* @param data ABI encoded function call to execute on this contract.
*/
function processMessageFromRoot(
uint256, /*stateId*/
uint256,
/*stateId*/
address rootMessageSender,
bytes calldata data
) public validateInternalCalls {
Expand Down Expand Up @@ -203,7 +204,6 @@ contract Polygon_SpokePool is IFxMessageProcessor, SpokePool, CircleCCTPAdapter
* whereby someone batches this call with a bunch of other calls and produces a very large L2 burn transaction.
* This might make the L2 -> L1 message fail due to exceeding the L1 calldata limit.
*/

function executeRelayerRefundLeaf(
uint32 rootBundleId,
SpokePoolInterface.RelayerRefundLeaf memory relayerRefundLeaf,
Expand All @@ -220,7 +220,6 @@ contract Polygon_SpokePool is IFxMessageProcessor, SpokePool, CircleCCTPAdapter
/**************************************
* INTERNAL FUNCTIONS *
**************************************/

function _setFxChild(address _fxChild) internal {
//slither-disable-next-line missing-zero-check
fxChild = _fxChild;
Expand All @@ -232,7 +231,7 @@ contract Polygon_SpokePool is IFxMessageProcessor, SpokePool, CircleCCTPAdapter
emit SetPolygonTokenBridger(address(_polygonTokenBridger));
}

function _preExecuteLeafHook(address) internal override {
function _preExecuteLeafHook(bytes32) internal override {
// Wraps MATIC --> WMATIC before distributing tokens from this contract.
_wrap();
}
Expand Down
Loading
Loading