Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonDmoney committed Nov 23, 2024
1 parent e9949b3 commit a8b2e86
Show file tree
Hide file tree
Showing 3 changed files with 254 additions and 250 deletions.
48 changes: 24 additions & 24 deletions src/Lock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "./mock/NativeBridge.sol";

contract Lock is Initializable, OwnableUpgradeable {
fstMOVE public fstmove;
IERC20 public move;
NativeBridge public movementBridge;
fstMOVE public fstmove;
IERC20 public move;
NativeBridge public movementBridge;

mapping(bytes32 => uint256) public deposits;
mapping(bytes32 => uint256) public deposits;

event Deposit(address eth, uint256 amount, bytes32 moveAddress);
event Deposit(address eth, uint256 amount, bytes32 moveAddress);

function initialize(address fstMOVE_, address move_, address bridge_) public initializer {
__Ownable_init(msg.sender);
function initialize(address fstMOVE_, address move_, address bridge_) public initializer {
__Ownable_init(msg.sender);

fstmove = fstMOVE(fstMOVE_);
move = IERC20(move_);
movementBridge = NativeBridge(bridge_);
}
fstmove = fstMOVE(fstMOVE_);
move = IERC20(move_);
movementBridge = NativeBridge(bridge_);
}

function deposit(address to, uint256 amount, bytes32 moveAddress) external {
move.transferFrom(msg.sender, address(this), amount);
fstmove.mintAssets(to, amount);
function deposit(address to, uint256 amount, bytes32 moveAddress) external {
move.transferFrom(msg.sender, address(this), amount);
fstmove.mintAssets(to, amount);

deposits[moveAddress] += amount;
deposits[moveAddress] += amount;

emit Deposit(to, amount, moveAddress);
}
emit Deposit(to, amount, moveAddress);
}

function bridge(bytes32 moveAddress, uint256 amount, bool max) external onlyOwner {
if (max) {
movementBridge.initiateBridgeTransfer(moveAddress, move.balanceOf(address(this)));
} else {
movementBridge.initiateBridgeTransfer(moveAddress, amount);
}
}
function bridge(bytes32 moveAddress, uint256 amount, bool max) external onlyOwner {
if (max) {
movementBridge.initiateBridgeTransfer(moveAddress, move.balanceOf(address(this)));
} else {
movementBridge.initiateBridgeTransfer(moveAddress, amount);
}
}
}
10 changes: 5 additions & 5 deletions src/mock/NativeBridge.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.8.20;

contract NativeBridge {
mapping(bytes32 => uint256) transfers;
mapping(bytes32 => uint256) transfers;

// MOCK OF https://github.com/movementlabsxyz/movement/blob/main/protocol-units/bridge/contracts/src/NativeBridge.sol#L43
function initiateBridgeTransfer(bytes32 recipient, uint256 amount) public {
transfers[recipient] += amount;
}
// MOCK OF https://github.com/movementlabsxyz/movement/blob/main/protocol-units/bridge/contracts/src/NativeBridge.sol#L43
function initiateBridgeTransfer(bytes32 recipient, uint256 amount) public {
transfers[recipient] += amount;
}
}
Loading

0 comments on commit a8b2e86

Please sign in to comment.