Skip to content

Commit

Permalink
lockevent should has target amount
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Sep 11, 2023
1 parent 07e9ac8 commit 173c726
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 212 deletions.
2 changes: 1 addition & 1 deletion helix-contract/address/ln-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"ProxyAdmin": "0xE3979fFa68BBa1F53c6F502c8F5788B370d28730",
"LnDefaultBridgeLogic": "0x43ae847d170e8AB26901a80b474d356Aaa30CEE1",
"LnOppositeBridgeLogic": "0xdE4667Fa1Db7a73914d13aF664933a027e5F9f54",
"LnOppositeBridgeLogic": "0x5ae6AF7b7fb6c869219289ba2570C6D4eF20Be2a",
"LnDefaultBridgeProxy": "0x54cc9716905ba8ebdD01E6364125cA338Cd0054E",
"LnOppositeBridgeProxy": "0x79e6f452f1e491a7aF0382FA0a6EF9368691960D"
}
1 change: 1 addition & 0 deletions helix-contract/contracts/ln/base/LnDefaultBridgeSource.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ contract LnDefaultBridgeSource {
require(_snapshot.totalFee >= providerFee + tokenInfo.protocolFee && providerFee > 0, "fee is invalid");

uint112 targetAmount = LnBridgeHelper.sourceAmountToTargetAmount(tokenInfo, _amount);
require(targetAmount > 0, "invalid target amount");
require(block.timestamp < type(uint32).max, "timestamp overflow");
bytes32 transferId = keccak256(abi.encodePacked(
block.chainid,
Expand Down
3 changes: 2 additions & 1 deletion helix-contract/contracts/ln/base/LnOppositeBridgeSource.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ contract LnOppositeBridgeSource {
require(_snapshot.totalFee >= tokenInfo.protocolFee + providerFee, "fee is invalid");

uint112 targetAmount = LnBridgeHelper.sourceAmountToTargetAmount(tokenInfo, _amount);
require(targetAmount > 0, "invalid amount");
require(block.timestamp < type(uint32).max, "timestamp overflow");
bytes32 transferId = keccak256(abi.encodePacked(
block.chainid,
Expand Down Expand Up @@ -250,7 +251,7 @@ contract LnOppositeBridgeSource {
_snapshot.provider,
_snapshot.sourceToken,
_snapshot.targetToken,
_amount,
targetAmount,
providerFee,
uint64(block.timestamp),
_receiver);
Expand Down
4 changes: 2 additions & 2 deletions helix-contract/deploy/deploy_ln_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ async function main() {
//const network = arbitrumNetwork;
const network = lineaNetwork;
const w = wallet(network.url);
await deployLnDefaultBridge(w, network.deployer, "ln-default-logic-v1.0.1");
await deployLnOppositeBridge(w, network.deployer, "ln-opposite-logic-v1.0.1");
//await deployLnDefaultBridge(w, network.deployer, "ln-default-logic-v1.0.1");
await deployLnOppositeBridge(w, network.deployer, "ln-opposite-logic-v1.0.2");
}

main()
Expand Down
2 changes: 1 addition & 1 deletion helix-contract/flatten/lnv2/Eth2LineaReceiveService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* '----------------' '----------------' '----------------' '----------------' '----------------' '
*
*
* 9/7/2023
* 9/11/2023
**/

pragma solidity ^0.8.10;
Expand Down
2 changes: 1 addition & 1 deletion helix-contract/flatten/lnv2/Eth2LineaSendService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* '----------------' '----------------' '----------------' '----------------' '----------------' '
*
*
* 9/7/2023
* 9/11/2023
**/

pragma solidity ^0.8.10;
Expand Down
Loading

0 comments on commit 173c726

Please sign in to comment.