Skip to content

Commit

Permalink
chore: restructure for monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrikhofstadt committed Jul 28, 2020
1 parent 82d07db commit d4fab11
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 25 deletions.
17 changes: 0 additions & 17 deletions contracts/WrappedSPL.sol

This file was deleted.

File renamed without changes.
File renamed without changes.
20 changes: 12 additions & 8 deletions contracts/Wormhole.sol → ethereum/contracts/Wormhole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ contract Wormhole {
}
}

function() public payable {
revert("please use lockETH to transfer ETH to Solana");
}

function changeGuardianAdmin(address newAddress) public {
require(guardians.contains(msg.sender), "sender is not a guardian");

Expand Down Expand Up @@ -175,6 +171,7 @@ contract Wormhole {
) public {
require(amount != 0, "amount must not be 0");

// TODO handle tokens that subtract fees
IERC20(asset).safeTransferFrom(msg.sender, address(this), amount);
emit LogTokensLocked(asset, recipient, amount);
}
Expand All @@ -184,14 +181,21 @@ contract Wormhole {
) public payable {
require(msg.value != 0, "amount must not be 0");

WETH(WETHAddress).deposit(msg.value);
// Wrap tx value in WETH
WETH(WETHAddress).deposit{value : msg.value}();

// Log deposit of WETH
emit LogTokensLocked(WETHAddress, recipient, msg.value);
}


fallback() external payable {revert("please use lockETH to transfer ETH to Solana");}
receive() external payable {revert("please use lockETH to transfer ETH to Solana");}
}


contract WETH is IERC20 {
function deposit() public payable {}
interface WETH is IERC20 {
function deposit() external payable;

function withdraw(uint256 amount) public {}
function withdraw(uint256 amount) external;
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions package.json → ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@openzeppelin/contracts": "^3.1.0"
},
"scripts": {
"build": "openzeppelin compile",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
Expand Down

0 comments on commit d4fab11

Please sign in to comment.