Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 9fc553d

Browse files
remove fund functions and add tests
1 parent 849db56 commit 9fc553d

File tree

3 files changed

+2
-25
lines changed

3 files changed

+2
-25
lines changed

contracts/ERC20Safe.sol

-11
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
1313
contract ERC20Safe {
1414
using SafeMath for uint256;
1515

16-
/**
17-
@notice Used to transfer tokens into the safe to fund proposals.
18-
@param tokenAddress Address of ERC20 to transfer.
19-
@param owner Address of current token owner.
20-
@param amount Amount of tokens to transfer.
21-
*/
22-
function fundERC20(address tokenAddress, address owner, uint256 amount) public {
23-
IERC20 erc20 = IERC20(tokenAddress);
24-
_safeTransferFrom(erc20, owner, address(this), amount);
25-
}
26-
2716
/**
2817
@notice Used to gain custody of deposited token.
2918
@param tokenAddress Address of ERC20 to transfer.

contracts/ERC721Safe.sol

-11
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ import "./ERC721MinterBurnerPauser.sol";
1212
contract ERC721Safe {
1313
using SafeMath for uint256;
1414

15-
/**
16-
@notice Used to transfer tokens into the safe to fund proposals.
17-
@param tokenAddress Address of ERC721 to transfer.
18-
@param owner Address of current token owner.
19-
@param tokenID ID of token to transfer.
20-
*/
21-
function fundERC721(address tokenAddress, address owner, uint tokenID) public {
22-
IERC721 erc721 = IERC721(tokenAddress);
23-
erc721.transferFrom(owner, address(this), tokenID);
24-
}
25-
2615
/**
2716
@notice Used to gain custoday of deposited token.
2817
@param tokenAddress Address of ERC721 to transfer.

test/contractBridge/admin.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,8 @@ contract('Bridge - [admin]', async accounts => {
174174
await ERC20MintableInstance.mint(tokenOwner, numTokens);
175175
ownerBalance = await ERC20MintableInstance.balanceOf(tokenOwner);
176176
assert.equal(ownerBalance, numTokens);
177-
178-
await ERC20MintableInstance.approve(ERC20HandlerInstance.address, numTokens);
179-
await ERC20HandlerInstance.fundERC20(ERC20MintableInstance.address, tokenOwner, numTokens);
177+
178+
await ERC20MintableInstance.transfer(ERC20HandlerInstance.address, numTokens);
180179
ownerBalance = await ERC20MintableInstance.balanceOf(tokenOwner);
181180
assert.equal(ownerBalance, 0);
182181
handlerBalance = await ERC20MintableInstance.balanceOf(ERC20HandlerInstance.address);

0 commit comments

Comments
 (0)