chore: restructure for monorepo

This commit is contained in:
Hendrik Hofstadt 2020-07-28 12:39:38 +02:00
parent 82d07db5e6
commit d4fab1190c
7 changed files with 13 additions and 25 deletions

View File

@ -1,17 +0,0 @@
// contracts/Wormhole.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract WrappedSPLToken is ERC20 {
constructor(address[] memory _guardians) public {
require(_guardians.length > 0, "no guardians specified");
for (uint i = 0; i < _guardians.length; i++) {
guardians.add(_guardians[i]);
}
}
}

View File

@ -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");
@ -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);
}
@ -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;
}

View File

@ -9,6 +9,7 @@
"@openzeppelin/contracts": "^3.1.0"
},
"scripts": {
"build": "openzeppelin compile",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",