Skip to content
This repository was archived by the owner on Sep 20, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [unreleased]

### Changed
- Removed ```isERC777``` functionality.

## [2.1.0] - 2018-04-26

### Changed
Expand Down
23 changes: 0 additions & 23 deletions contracts/Vault/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ contract Vault is Ownable, VaultInterface {

address constant public ETH = 0x0;

mapping (address => bool) public isERC777;

// user => spender => approved
mapping (address => mapping (address => bool)) private approved;
mapping (address => mapping (address => uint)) private balances;
Expand Down Expand Up @@ -135,25 +133,9 @@ contract Vault is Ownable, VaultInterface {
}

function tokensReceived(address, address from, address, uint amount, bytes, bytes) public {
if (!isERC777[msg.sender]) {
isERC777[msg.sender] = true;
}

depositFor(from, msg.sender, amount);
}

/// @dev Marks a token as an ERC777 token.
/// @param token Address of the token.
function setERC777(address token) public onlyOwner {
isERC777[token] = true;
}

/// @dev Unmarks a token as an ERC777 token.
/// @param token Address of the token.
function unsetERC777(address token) public onlyOwner {
isERC777[token] = false;
}

/// @dev Allows owner to withdraw tokens accidentally sent to the contract.
/// @param token Address of the token to withdraw.
function withdrawOverflow(address token) public onlyOwner {
Expand Down Expand Up @@ -199,11 +181,6 @@ contract Vault is Ownable, VaultInterface {
return;
}

if (isERC777[token]) {
ERC777(token).send(user, amount);
return;
}

require(ERC20(token).transfer(user, amount));
}
}
8 changes: 0 additions & 8 deletions test/TestVault.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ contract('Vault', function (accounts) {
});
});

it('should allow setting and unsetting of ERC777 token', async () => {
await vault.setERC777(token.address, {from: accounts[0]});
assert.equal(await vault.isERC777(token.address), true);

await vault.unsetERC777(token.address, {from: accounts[0]});
assert.equal(await vault.isERC777(token.address), false);
});

it('should allow a maker to approve and unapprove an exchange', async () => {
await vault.addSpender(accounts[1]);

Expand Down