Skip to content

Commit

Permalink
ditto
Browse files Browse the repository at this point in the history
  • Loading branch information
polymorpher committed Oct 20, 2024
1 parent 6616e67 commit 8a78cc4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 54 deletions.
52 changes: 26 additions & 26 deletions test/FoodMemeFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {OFTComposeMsgCodec} from "@layerzerolabs/oft-evm/libs/OFTComposeMsgCodec
// DevTools imports
import {TestHelperOz5} from "@layerzerolabs/test-devtools-evm-foundry/contracts/TestHelperOz5.sol";


contract FoodMemeFactoryTest is TestHelperOz5 {
uint256 DEPLOYER_PRIVATE_KEY = vm.envUint("DEPLOYER_PRIVATE_KEY");
address deployer = vm.addr(DEPLOYER_PRIVATE_KEY);

using OptionsBuilder for bytes;

uint32 private aEid = 1;
Expand Down Expand Up @@ -180,29 +180,29 @@ contract FoodMemeFactoryTest is TestHelperOz5 {
assertEq(aOFT.token(), address(aOFT));
assertEq(bOFT.token(), address(bOFT));
}
//
// function test_send_oft() public {
// uint256 tokensToSend = 1 ether;
// bytes memory options = OptionsBuilder.newOptions().addExecutorLzReceiveOption(200000, 0);
// SendParam memory sendParam = SendParam(
// bEid,
// addressToBytes32(userB),
// tokensToSend,
// tokensToSend,
// options,
// "",
// ""
// );
// MessagingFee memory fee = aOFT.quoteSend(sendParam, false);
//
// assertEq(aOFT.balanceOf(userA), initialBalance);
// assertEq(bOFT.balanceOf(userB), initialBalance);
//
// vm.prank(userA);
// aOFT.send{value: fee.nativeFee}(sendParam, fee, payable(address(this)));
// verifyPackets(bEid, addressToBytes32(address(bOFT)));
//
// assertEq(aOFT.balanceOf(userA), initialBalance - tokensToSend);
// assertEq(bOFT.balanceOf(userB), initialBalance + tokensToSend);
// }
//
// function test_send_oft() public {
// uint256 tokensToSend = 1 ether;
// bytes memory options = OptionsBuilder.newOptions().addExecutorLzReceiveOption(200000, 0);
// SendParam memory sendParam = SendParam(
// bEid,
// addressToBytes32(userB),
// tokensToSend,
// tokensToSend,
// options,
// "",
// ""
// );
// MessagingFee memory fee = aOFT.quoteSend(sendParam, false);
//
// assertEq(aOFT.balanceOf(userA), initialBalance);
// assertEq(bOFT.balanceOf(userB), initialBalance);
//
// vm.prank(userA);
// aOFT.send{value: fee.nativeFee}(sendParam, fee, payable(address(this)));
// verifyPackets(bEid, addressToBytes32(address(bOFT)));
//
// assertEq(aOFT.balanceOf(userA), initialBalance - tokensToSend);
// assertEq(bOFT.balanceOf(userB), initialBalance + tokensToSend);
// }
}
44 changes: 16 additions & 28 deletions test/mock/ILayerZeroUltraLightNodeV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ interface ILayerZeroUltraLightNodeV2 {
function validateTransactionProof(
uint16 _srcChainId,
address _dstAddress,
uint _gasLimit,
uint256 _gasLimit,
bytes32 _lookupHash,
bytes32 _blockData,
bytes calldata _transactionProof
) external;

// an Oracle delivers the block data using updateHash()
function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint _confirmations, bytes32 _blockData) external;
function updateHash(uint16 _srcChainId, bytes32 _lookupHash, uint256 _confirmations, bytes32 _blockData) external;

// can only withdraw the receivable of the msg.sender
function withdrawNative(address payable _to, uint _amount) external;
function withdrawNative(address payable _to, uint256 _amount) external;

function withdrawZRO(address _to, uint _amount) external;
function withdrawZRO(address _to, uint256 _amount) external;

// view functions
function getAppConfig(
uint16 _remoteChainId,
address _userApplicationAddress
) external view returns (ApplicationConfiguration memory);
function getAppConfig(uint16 _remoteChainId, address _userApplicationAddress)
external
view
returns (ApplicationConfiguration memory);

function accruedNativeFee(address _address) external view returns (uint);
function accruedNativeFee(address _address) external view returns (uint256);

struct ApplicationConfiguration {
uint16 inboundProofLibraryVersion;
Expand All @@ -40,32 +40,20 @@ interface ILayerZeroUltraLightNodeV2 {
}

event HashReceived(
uint16 indexed srcChainId,
address indexed oracle,
bytes32 lookupHash,
bytes32 blockData,
uint confirmations
uint16 indexed srcChainId, address indexed oracle, bytes32 lookupHash, bytes32 blockData, uint256 confirmations
);
event RelayerParams(bytes adapterParams, uint16 outboundProofType);
event Packet(bytes payload);
event InvalidDst(
uint16 indexed srcChainId,
bytes srcAddress,
address indexed dstAddress,
uint64 nonce,
bytes32 payloadHash
uint16 indexed srcChainId, bytes srcAddress, address indexed dstAddress, uint64 nonce, bytes32 payloadHash
);
event PacketReceived(
uint16 indexed srcChainId,
bytes srcAddress,
address indexed dstAddress,
uint64 nonce,
bytes32 payloadHash
uint16 indexed srcChainId, bytes srcAddress, address indexed dstAddress, uint64 nonce, bytes32 payloadHash
);
event AppConfigUpdated(address indexed userApplication, uint indexed configType, bytes newConfig);
event AppConfigUpdated(address indexed userApplication, uint256 indexed configType, bytes newConfig);
event AddInboundProofLibraryForChain(uint16 indexed chainId, address lib);
event EnableSupportedOutboundProof(uint16 indexed chainId, uint16 proofType);
event SetChainAddressSize(uint16 indexed chainId, uint size);
event SetChainAddressSize(uint16 indexed chainId, uint256 size);
event SetDefaultConfigForChainId(
uint16 indexed chainId,
uint16 inboundProofLib,
Expand All @@ -79,6 +67,6 @@ interface ILayerZeroUltraLightNodeV2 {
event SetLayerZeroToken(address indexed tokenAddress);
event SetRemoteUln(uint16 indexed chainId, bytes32 uln);
event SetTreasury(address indexed treasuryAddress);
event WithdrawZRO(address indexed msgSender, address indexed to, uint amount);
event WithdrawNative(address indexed msgSender, address indexed to, uint amount);
event WithdrawZRO(address indexed msgSender, address indexed to, uint256 amount);
event WithdrawNative(address indexed msgSender, address indexed to, uint256 amount);
}

0 comments on commit 8a78cc4

Please sign in to comment.