From 80be1b4581f6b822fe184423045932b76507a451 Mon Sep 17 00:00:00 2001 From: decanus Date: Sun, 20 May 2018 22:55:27 +0200 Subject: [PATCH 1/2] removed isERC77 --- contracts/Vault/Vault.sol | 23 ----------------------- test/TestVault.js | 8 -------- 2 files changed, 31 deletions(-) diff --git a/contracts/Vault/Vault.sol b/contracts/Vault/Vault.sol index 39047c3..fc9d709 100644 --- a/contracts/Vault/Vault.sol +++ b/contracts/Vault/Vault.sol @@ -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; @@ -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 { @@ -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)); } } diff --git a/test/TestVault.js b/test/TestVault.js index 649542a..a696b43 100644 --- a/test/TestVault.js +++ b/test/TestVault.js @@ -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]); From 4e6b7019c3afef7aaa459ce7b93fef6c1b53f094 Mon Sep 17 00:00:00 2001 From: Dean Eigenmann Date: Sun, 20 May 2018 23:00:51 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca41a84..bdfb5b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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