Skip to content

Commit 48037f1

Browse files
fix: partial review
1 parent 312c5be commit 48037f1

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

src/proposals/20260716/SparkEthereum_20260716.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ contract SparkEthereum_20260716 is SparkPayloadEthereum {
5353

5454
constructor() {
5555
// PAYLOAD_ROBINHOOD =
56+
// PAYLOAD_XLAYER =
5657
}
5758

5859
function _postExecute() internal override {

src/proposals/20260716/Spell_20260716.t.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,29 @@ contract SparkEthereum_20260716_SLLTests is SparkLiquidityLayerTests {
566566
assertEq(proxy.hasRole(proxy.DEFAULT_ADMIN_ROLE(), Robinhood.SPARK_EXECUTOR), true);
567567
}
568568

569+
function test_ETHEREUM_sll_enableUSDTBridgingToXLayer() external onChain(ChainIdUtils.Ethereum()) {
570+
MainnetController controller = MainnetController(Ethereum.ALM_CONTROLLER);
571+
572+
bytes32 layerZeroTransferKey = keccak256(abi.encode(
573+
controller.LIMIT_LAYERZERO_TRANSFER(),
574+
USDT_OFT,
575+
LZ_EID_XLAYER
576+
));
577+
578+
_assertRateLimit(layerZeroTransferKey, 0, 0);
579+
580+
assertEq(controller.layerZeroRecipients(LZ_EID_XLAYER), bytes32(0));
581+
582+
_executeAllPayloadsAndBridges();
583+
584+
_assertRateLimit(layerZeroTransferKey, 5_000_000e6, 100_000_000e6 / uint256(1 days));
585+
586+
assertEq(
587+
controller.layerZeroRecipients(LZ_EID_XLAYER),
588+
bytes32(uint256(uint160(XLayer.ALM_PROXY)))
589+
);
590+
}
591+
569592
}
570593

571594
contract SparkEthereum_20260716_SparklendTests is SparklendTests {

src/proposals/20260716/XLayer_20260716.t.sol

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ interface IXLayerReceiver {
3838

3939
}
4040

41+
interface IXLayerALMProxyFreezable {
42+
43+
function DEFAULT_ADMIN_ROLE() external view returns (bytes32);
44+
45+
function ALLOCATOR_ROLE() external view returns (bytes32);
46+
47+
function FREEZER_ROLE() external view returns (bytes32);
48+
49+
function hasRole(bytes32 role, address account) external view returns (bool);
50+
51+
}
52+
4153
contract XLayerConfigTests is Test {
4254

4355
bytes32 internal constant DEFAULT_ADMIN_ROLE = 0x00;
@@ -123,6 +135,12 @@ contract XLayerConfigTests is Test {
123135
assertEq(spusdtVault.hasRole(DEFAULT_ADMIN_ROLE, DEPLOYER), false);
124136
assertEq(spusdtVault.hasRole(spusdtVault.SETTER_ROLE(), DEPLOYER), false);
125137
assertEq(spusdtVault.hasRole(spusdtVault.TAKER_ROLE(), DEPLOYER), false);
138+
139+
IXLayerALMProxyFreezable almProxyFreezable = IXLayerALMProxyFreezable(SETTER);
140+
141+
assertEq(almProxyFreezable.hasRole(almProxyFreezable.DEFAULT_ADMIN_ROLE(), DEPLOYER), false);
142+
assertEq(almProxyFreezable.hasRole(almProxyFreezable.ALLOCATOR_ROLE(), DEPLOYER), false);
143+
assertEq(almProxyFreezable.hasRole(almProxyFreezable.FREEZER_ROLE(), DEPLOYER), false);
126144
}
127145

128146
function test_vault_config() external view {
@@ -190,6 +208,16 @@ contract XLayerConfigTests is Test {
190208
assertEq(IXLayerReceiver(RECEIVER).target(), EXECUTOR);
191209
}
192210

211+
function test_almProxyFreezable_config() external view {
212+
IXLayerALMProxyFreezable proxy = IXLayerALMProxyFreezable(SETTER);
213+
214+
assertEq(proxy.hasRole(proxy.DEFAULT_ADMIN_ROLE(), EXECUTOR), true);
215+
216+
assertEq(proxy.hasRole(proxy.ALLOCATOR_ROLE(), RELAYER_1), false);
217+
assertEq(proxy.hasRole(proxy.ALLOCATOR_ROLE(), RELAYER_2), false);
218+
assertEq(proxy.hasRole(proxy.FREEZER_ROLE(), FREEZER), false);
219+
}
220+
193221
}
194222

195223
contract XLayerE2ETests is Test {

0 commit comments

Comments
 (0)