Skip to content

Commit

Permalink
fix: base usds contract support and scroll prepare fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaShWoof committed Feb 7, 2025
1 parent ff81ff3 commit a82a1b0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/prepare-migration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- base
- optimism
- mantle
- scroll
deployment:
description: Deployment Name (e.g. "usdc")
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
bases: [ development, mainnet, mainnet-weth, mainnet-usdt, mainnet-wsteth, mainnet-usds, sepolia-usdc, sepolia-weth, fuji, polygon, polygon-usdt, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-usdt, base-usdbc, base-weth, base-usdc, base-aero, base-usds, optimism-usdc, optimism-usdt, optimism-weth, mantle-usde, scroll-usdc]
bases: [ development, mainnet, mainnet-weth, mainnet-usdt, mainnet-wsteth, mainnet-usds, sepolia-usdc, sepolia-weth, fuji, polygon, polygon-usdt, arbitrum-usdc.e, arbitrum-usdc, arbitrum-weth, arbitrum-usdt, base-usdbc, base-weth, base-usdc, base-aero, optimism-usdc, optimism-usdt, optimism-weth, mantle-usde, scroll-usdc]
name: Run scenarios
env:
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }}
Expand Down
9 changes: 8 additions & 1 deletion deployments/mainnet/usdc/relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,12 @@ export default {
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
}
}
}
},
baseL1USDSBridge: {
delegates: {
field: {
slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
}
}
},
};
1 change: 1 addition & 0 deletions deployments/mainnet/usdc/roots.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"CCTPMessageTransmitter": "0x0a992d191deec32afe36203ad87d7d289a738f81",
"baseL1CrossDomainMessenger": "0x866E82a600A1414e583f7F13623F1aC5d58b0Afa",
"baseL1StandardBridge": "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
"baseL1USDSBridge": "0xA5874756416Fa632257eEA380CAbd2E87cED352A",
"opL1CrossDomainMessenger": "0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1",
"opL1StandardBridge": "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1",
"mantleL1CrossDomainMessenger": "0x676A795fe6E43C17c668de16730c3F690FEB7120",
Expand Down
2 changes: 2 additions & 0 deletions scenario/SupplyScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ scenario(
symbol === 'wstETH' ? /0xc2139725/ : /.^/,
symbol === 'WMATIC' ? /Transaction reverted without a reason string/ : /.^/,
symbol === 'WPOL' ? /Transaction reverted without a reason string/ : /.^/,
symbol === 'sUSDS' ? /SUsds\/insufficient-allowance/ : /.^/,
]
);
}
Expand Down Expand Up @@ -597,6 +598,7 @@ scenario(
symbol === 'wstETH' ? /0x00b284f2/ : /.^/,
symbol === 'WMATIC' ? /Transaction reverted without a reason string/ : /.^/,
symbol === 'WPOL' ? /Transaction reverted without a reason string/ : /.^/,
symbol === 'sUSDS' ? /SUsds\/insufficient-balance/ : /.^/,
]
);
}
Expand Down
5 changes: 4 additions & 1 deletion scenario/utils/isBridgeProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ export async function isBridgeProposal(
const baseL1StandardBridge = await governanceDeploymentManager.getContractOrThrow(
'baseL1StandardBridge'
);
const bridgeContracts = [baseL1CrossDomainMessenger.address, baseL1StandardBridge.address];
const baseL1USDSBridge = await governanceDeploymentManager.getContractOrThrow(
'baseL1USDSBridge'
);
const targets = openProposal.targets;
const bridgeContracts = [baseL1CrossDomainMessenger.address, baseL1StandardBridge.address, baseL1USDSBridge.address];
return targets.some(t => bridgeContracts.includes(t));
}
// case 'linea': {
Expand Down
6 changes: 4 additions & 2 deletions scenario/utils/relayBaseMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { setNextBaseFeeToZero, setNextBlockTimestamp } from './hreUtils';
import { BigNumber, ethers } from 'ethers';
import { Log } from '@ethersproject/abstract-provider';
import { OpenBridgedProposal } from '../context/Gov';

/*
The Base relayer applies an offset to the message sender.
Expand All @@ -27,6 +26,7 @@ export default async function relayBaseMessage(
const bridgeReceiver = await bridgeDeploymentManager.getContractOrThrow('bridgeReceiver');
const l2CrossDomainMessenger = await bridgeDeploymentManager.getContractOrThrow('l2CrossDomainMessenger');
const l2StandardBridge = await bridgeDeploymentManager.getContractOrThrow('l2StandardBridge');
const l2USDSBridge = await bridgeDeploymentManager.contract('l2USDSBridge');

const openBridgedProposals: OpenBridgedProposal[] = [];

Expand Down Expand Up @@ -63,7 +63,9 @@ export default async function relayBaseMessage(
// there are two types:
// 1. Bridging ERC20 token or ETH
// 2. Cross-chain message passing
if (target === l2StandardBridge.address) {
if (target === l2StandardBridge.address ||
(l2USDSBridge ? target === l2USDSBridge.address : target.toLowerCase() === '0xee44cdb68D618d58F75d9fe0818B640BD7B8A7B7'.toLowerCase())
) {
// Bridging ERC20 token
const messageWithoutPrefix = message.slice(2); // strip out the 0x prefix
const messageWithoutSigHash = '0x' + messageWithoutPrefix.slice(8);
Expand Down

0 comments on commit a82a1b0

Please sign in to comment.