From 2582a2a0655ff60d65c8a2b54d9784794bf2c98c Mon Sep 17 00:00:00 2001 From: Bertrand Masius Date: Sun, 17 Mar 2019 14:14:54 +0100 Subject: [PATCH] ERC777 Update to solc 0.5.2 (#1159) --- contracts/drafts/ERC777/ERC777.sol | 12 ++--- contracts/drafts/ERC777/ERC777Base.sol | 46 +++++++++---------- contracts/drafts/ERC777/ERC777Burnable.sol | 8 ++-- contracts/drafts/ERC777/IERC777.sol | 20 ++++---- .../drafts/ERC777/IERC777TokensRecipient.sol | 7 ++- .../drafts/ERC777/IERC777TokensSender.sol | 7 ++- contracts/introspection/ERC1820Client.sol | 2 +- contracts/introspection/IERC1820.sol | 4 +- contracts/mocks/ERC777ReceiverMock.sol | 6 +-- contracts/mocks/ERC777SenderMock.sol | 20 +++++--- test/drafts/ERC777/ERC777.test.js | 44 +++++++++--------- test/helpers/expectEvent.js | 12 ++--- test/introspection/ERC1820Deploy.js | 4 +- 13 files changed, 98 insertions(+), 94 deletions(-) diff --git a/contracts/drafts/ERC777/ERC777.sol b/contracts/drafts/ERC777/ERC777.sol index 943183a7ca5..84580ce8d2c 100644 --- a/contracts/drafts/ERC777/ERC777.sol +++ b/contracts/drafts/ERC777/ERC777.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; import "./ERC777Base.sol"; @@ -21,13 +21,13 @@ contract ERC777 is ERC777Base { * @param operatorData bytes extra information provided by the operator (if any) */ constructor( - string name, - string symbol, + string memory name, + string memory symbol, uint256 granularity, - address[] defaultOperators, + address[] memory defaultOperators, uint256 initialSupply, - bytes data, - bytes operatorData + bytes memory data, + bytes memory operatorData ) ERC777Base( name, diff --git a/contracts/drafts/ERC777/ERC777Base.sol b/contracts/drafts/ERC777/ERC777Base.sol index dc2846e28c1..d0c89b99cbf 100644 --- a/contracts/drafts/ERC777/ERC777Base.sol +++ b/contracts/drafts/ERC777/ERC777Base.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; import "./IERC777.sol"; import "./IERC777TokensRecipient.sol"; @@ -37,10 +37,10 @@ contract ERC777Base is IERC777, ERC1820Client { mapping(address => mapping(address => bool)) private _ops; constructor( - string name, - string symbol, + string memory name, + string memory symbol, uint256 granularity, - address[] defaultOperators + address[] memory defaultOperators ) internal { require(granularity > 0); _name = name; @@ -67,7 +67,7 @@ contract ERC777Base is IERC777, ERC1820Client { function send( address to, uint256 amount, - bytes data + bytes calldata data ) external { _send( msg.sender, @@ -91,8 +91,8 @@ contract ERC777Base is IERC777, ERC1820Client { address from, address to, uint256 amount, - bytes data, - bytes operatorData + bytes calldata data, + bytes calldata operatorData ) external { @@ -112,7 +112,7 @@ contract ERC777Base is IERC777, ERC1820Client { * @param amount uint256 amount of tokens to transfer * @param data bytes extra information provided by the token holder */ - function burn(uint256 amount, bytes data) external { + function burn(uint256 amount, bytes calldata data) external { _burn( msg.sender, msg.sender, @@ -132,8 +132,8 @@ contract ERC777Base is IERC777, ERC1820Client { function operatorBurn( address from, uint256 amount, - bytes data, - bytes operatorData + bytes calldata data, + bytes calldata operatorData ) external { @@ -150,14 +150,14 @@ contract ERC777Base is IERC777, ERC1820Client { /** * @return the name of the token. */ - function name() public view returns (string) { + function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ - function symbol() public view returns (string) { + function symbol() public view returns (string memory) { return _symbol; } @@ -191,7 +191,7 @@ contract ERC777Base is IERC777, ERC1820Client { * @dev Get the list of default operators as defined by the token contract. * @return address[] default operators */ - function defaultOperators() public view returns (address[]) { + function defaultOperators() public view returns (address[] memory) { return _defaultOpsArray; } @@ -246,8 +246,8 @@ contract ERC777Base is IERC777, ERC1820Client { address operator, address from, uint256 amount, - bytes data, - bytes operatorData + bytes memory data, + bytes memory operatorData ) internal { @@ -290,8 +290,8 @@ contract ERC777Base is IERC777, ERC1820Client { address operator, address to, uint256 amount, - bytes userData, - bytes operatorData + bytes memory userData, + bytes memory operatorData ) internal { @@ -373,8 +373,8 @@ contract ERC777Base is IERC777, ERC1820Client { address from, address to, uint256 amount, - bytes userData, - bytes operatorData + bytes memory userData, + bytes memory operatorData ) private { @@ -430,8 +430,8 @@ contract ERC777Base is IERC777, ERC1820Client { address from, address to, uint256 amount, - bytes userData, - bytes operatorData + bytes memory userData, + bytes memory operatorData ) private { @@ -464,8 +464,8 @@ contract ERC777Base is IERC777, ERC1820Client { address from, address to, uint256 amount, - bytes userData, - bytes operatorData + bytes memory userData, + bytes memory operatorData ) private returns(bool) diff --git a/contracts/drafts/ERC777/ERC777Burnable.sol b/contracts/drafts/ERC777/ERC777Burnable.sol index 8993e842cd5..2aeb883b9b2 100644 --- a/contracts/drafts/ERC777/ERC777Burnable.sol +++ b/contracts/drafts/ERC777/ERC777Burnable.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; import "./ERC777Base.sol"; @@ -15,7 +15,7 @@ contract ERC777Burnable is ERC777Base { * @param amount uint256 amount of tokens to transfer * @param data bytes data provided by the token holder */ - function burn(uint256 amount, bytes data) external { + function burn(uint256 amount, bytes calldata data) external { _burn( msg.sender, msg.sender, @@ -35,8 +35,8 @@ contract ERC777Burnable is ERC777Base { function operatorBurn( address from, uint256 amount, - bytes data, - bytes operatorData + bytes calldata data, + bytes calldata operatorData ) external { address holder = from == address(0) ? msg.sender : from; _burn( diff --git a/contracts/drafts/ERC777/IERC777.sol b/contracts/drafts/ERC777/IERC777.sol index 8168abe8f8b..4b6b99bfee3 100644 --- a/contracts/drafts/ERC777/IERC777.sol +++ b/contracts/drafts/ERC777/IERC777.sol @@ -1,13 +1,13 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; /** * @title ERC777 interface * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-777.md */ interface IERC777 { - function name() external view returns (string); + function name() external view returns (string memory); - function symbol() external view returns (string); + function symbol() external view returns (string memory); function totalSupply() external view returns (uint256); @@ -15,7 +15,7 @@ interface IERC777 { function granularity() external view returns (uint256); - function defaultOperators() external view returns (address[]); + function defaultOperators() external view returns (address[] memory); function authorizeOperator(address operator) external; @@ -26,23 +26,23 @@ interface IERC777 { address tokenHolder ) external view returns (bool); - function send(address to, uint256 amount, bytes data) external; + function send(address to, uint256 amount, bytes calldata data) external; function operatorSend( address from, address to, uint256 amount, - bytes data, - bytes operatorData + bytes calldata data, + bytes calldata operatorData ) external; - function burn(uint256 amount, bytes data) external; + function burn(uint256 amount, bytes calldata data) external; function operatorBurn( address from, uint256 amount, - bytes data, - bytes operatorData + bytes calldata data, + bytes calldata operatorData ) external; event Sent( diff --git a/contracts/drafts/ERC777/IERC777TokensRecipient.sol b/contracts/drafts/ERC777/IERC777TokensRecipient.sol index ce7e11d3e34..c44fc53f04d 100644 --- a/contracts/drafts/ERC777/IERC777TokensRecipient.sol +++ b/contracts/drafts/ERC777/IERC777TokensRecipient.sol @@ -1,8 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -// solhint-disable-next-line compiler-fixed -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; interface IERC777TokensRecipient { function tokensReceived( @@ -10,7 +9,7 @@ interface IERC777TokensRecipient { address from, address to, uint amount, - bytes userData, - bytes operatorData + bytes calldata userData, + bytes calldata operatorData ) external; } diff --git a/contracts/drafts/ERC777/IERC777TokensSender.sol b/contracts/drafts/ERC777/IERC777TokensSender.sol index 54570a81932..73b2e79a8f0 100644 --- a/contracts/drafts/ERC777/IERC777TokensSender.sol +++ b/contracts/drafts/ERC777/IERC777TokensSender.sol @@ -1,8 +1,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -// solhint-disable-next-line compiler-fixed -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; interface IERC777TokensSender { function tokensToSend( @@ -10,7 +9,7 @@ interface IERC777TokensSender { address from, address to, uint amount, - bytes userData, - bytes operatorData + bytes calldata userData, + bytes calldata operatorData ) external; } diff --git a/contracts/introspection/ERC1820Client.sol b/contracts/introspection/ERC1820Client.sol index efe1e7811c3..1c9084195fe 100644 --- a/contracts/introspection/ERC1820Client.sol +++ b/contracts/introspection/ERC1820Client.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; import "./IERC1820.sol"; diff --git a/contracts/introspection/IERC1820.sol b/contracts/introspection/IERC1820.sol index 76c4ade9743..1572e39206e 100644 --- a/contracts/introspection/IERC1820.sol +++ b/contracts/introspection/IERC1820.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; /** * @title IERC1820 @@ -24,7 +24,7 @@ interface IERC1820 { function getManager(address _addr) external view returns(address); function interfaceHash( - string _interfaceName + string calldata _interfaceName ) external pure returns(bytes32); function updateERC165Cache( diff --git a/contracts/mocks/ERC777ReceiverMock.sol b/contracts/mocks/ERC777ReceiverMock.sol index 3c4b744db0b..a0f6b9f4d44 100644 --- a/contracts/mocks/ERC777ReceiverMock.sol +++ b/contracts/mocks/ERC777ReceiverMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; import "../drafts/ERC777/IERC777TokensRecipient.sol"; import "../introspection/ERC1820Client.sol"; @@ -44,8 +44,8 @@ contract ERC777ReceiverMock is IERC777TokensRecipient, ERC1820Client { address from, address to, uint256 amount, - bytes userData, - bytes operatorData + bytes calldata userData, + bytes calldata operatorData ) external { diff --git a/contracts/mocks/ERC777SenderMock.sol b/contracts/mocks/ERC777SenderMock.sol index 481f0ffe778..cd63393846f 100644 --- a/contracts/mocks/ERC777SenderMock.sol +++ b/contracts/mocks/ERC777SenderMock.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.4.24; +pragma solidity ^0.5.2; import "../drafts/ERC777/IERC777.sol"; import "../drafts/ERC777/IERC777TokensSender.sol"; @@ -26,7 +26,11 @@ contract ERC777SenderMock is IERC777TokensSender, ERC1820Client { _erc777 = erc777; // register interface if (setInterface) { - setInterfaceImplementer(address(this), keccak256("ERC777TokensSender"), address(this)); + setInterfaceImplementer( + address(this), + keccak256("ERC777TokensSender"), + address(this) + ); } } @@ -36,7 +40,11 @@ contract ERC777SenderMock is IERC777TokensSender, ERC1820Client { * @param amount uint256 amount of tokens to transfer * @param data bytes extra information provided by the token holder (if any) */ - function sendTokens(address to, uint amount, bytes data) external { + function sendTokens( + address to, + uint amount, + bytes calldata data + ) external { IERC777(_erc777).send(to, amount, data); } @@ -45,7 +53,7 @@ contract ERC777SenderMock is IERC777TokensSender, ERC1820Client { * @param amount uint256 amount of tokens to transfer * @param data bytes extra information provided by the token holder (if any) */ - function burnTokens(uint amount, bytes data) external { + function burnTokens(uint amount, bytes calldata data) external { IERC777(_erc777).burn(amount, data); } @@ -71,8 +79,8 @@ contract ERC777SenderMock is IERC777TokensSender, ERC1820Client { address from, address to, uint256 amount, - bytes userData, - bytes operatorData + bytes calldata userData, + bytes calldata operatorData ) external { diff --git a/test/drafts/ERC777/ERC777.test.js b/test/drafts/ERC777/ERC777.test.js index 334129b07ef..c0fcc08537b 100644 --- a/test/drafts/ERC777/ERC777.test.js +++ b/test/drafts/ERC777/ERC777.test.js @@ -1,4 +1,4 @@ -const { assertRevert } = require('../../helpers/assertRevert'); +const { BN, constants, should, shouldFail } = require('openzeppelin-test-helpers'); const expectEvent = require('../../helpers/expectEvent'); const { ERC1820Deploy } = require('../../introspection/ERC1820Deploy'); @@ -7,11 +7,7 @@ const ERC1820 = artifacts.require('IERC1820'); const ERC777TokensRecipient = artifacts.require('ERC777ReceiverMock'); const ERC777TokensSender = artifacts.require('ERC777SenderMock'); -const BigNumber = web3.utils.BN; - -require('chai') - .use(require('chai-bignumber')(BigNumber)) - .should(); +const BigNumber = BN; contract('ERC777', function ([_, holder, operator, anotherAccount]) { const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; @@ -91,11 +87,11 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { }); it('value is checked to be greater or equal to 1', async function () { - await assertRevert(ERC777.new('Test777', 'T77', 0, [], INITIAL_SUPPLY, USER_DATA, OPERATOR_DATA)); + await shouldFail.reverting(ERC777.new('Test777', 'T77', 0, [], INITIAL_SUPPLY, USER_DATA, OPERATOR_DATA)); }); it('initialSupply is a multiple of granularity', async function () { - await assertRevert(ERC777.new('Test777', 'T77', '7', [], '11', USER_DATA, OPERATOR_DATA)); + await shouldFail.reverting(ERC777.new('Test777', 'T77', '7', [], '11', USER_DATA, OPERATOR_DATA)); }); }); @@ -130,7 +126,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { }); it('revert when token holder authorizes itself as operator', async function () { - await assertRevert(this.token.authorizeOperator(holder, { from: holder })); + await shouldFail.reverting(this.token.authorizeOperator(holder, { from: holder })); }); }); @@ -157,7 +153,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { }); it('revert when token holder revoke itself as operator', async function () { - await assertRevert(this.token.revokeOperator(holder, { from: holder })); + await shouldFail.reverting(this.token.revokeOperator(holder, { from: holder })); }); }); }); @@ -255,7 +251,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { it('revert when sending an amount of token from an account with insufficient balance', async function () { const amount = parseInt(INITIAL_SUPPLY, 10) + 100; const userData = '0xdeadbeef'; - await assertRevert( + await shouldFail.reverting( this.token.contract.methods.send(operator, amount.toString(), userData).send({ from: holder }) ); }); @@ -340,7 +336,9 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { it('revert when sending an amount of token to address(0)', async function () { const userData = '0xdeadbeef'; - await assertRevert(this.token.contract.methods.send(ZERO_ADDRESS, '100', userData).send({ from: holder })); + await shouldFail.reverting( + this.token.contract.methods.send(ZERO_ADDRESS, '100', userData).send({ from: holder }) + ); }); it('revert when sending an amount which is not a multiple of granularity', async function () { @@ -348,7 +346,9 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { const tempToken = await ERC777.new( 'Test777', 'T77', 10, [], INITIAL_SUPPLY, USER_DATA, OPERATOR_DATA, { from: holder } ); - await assertRevert(tempToken.contract.methods.send(anotherAccount, '15', userData).send({ from: holder })); + await shouldFail.reverting( + tempToken.contract.methods.send(anotherAccount, '15', userData).send({ from: holder }) + ); }); }); }); @@ -418,7 +418,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { ); const userData = '0xdeadbeef'; const opData = '0xbabecafe'; - await assertRevert( + await shouldFail.reverting( tempToken.contract.methods.operatorSend( holder, anotherAccount, @@ -462,7 +462,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { const userData = '0xdeadbeef'; const opData = '0xbabecafe'; - await assertRevert( + await shouldFail.reverting( this.token.contract.methods.operatorSend( holder, anotherAccount, @@ -508,7 +508,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { it('revert when recipient is address(0)', async function () { const userData = '0xdeadbeef'; const opData = '0xbabecafe'; - await assertRevert( + await shouldFail.reverting( this.token.contract.methods.operatorSend( holder, ZERO_ADDRESS, @@ -532,7 +532,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { OPERATOR_DATA, { from: holder } ); - await assertRevert( + await shouldFail.reverting( tempToken.contract.methods.operatorSend( holder, anotherAccount, @@ -688,7 +688,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { it('revert when burning an amount of token from an account with insufficient balance', async function () { const amount = parseInt(INITIAL_SUPPLY, 10) + 100; - await assertRevert(this.token.contract.methods.burn(amount.toString(), userData).send({ from: holder })); + await shouldFail.reverting(this.token.contract.methods.burn(amount.toString(), userData).send({ from: holder })); }); describe('burning an amount of token from an account with sufficient balance', function () { @@ -762,7 +762,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { OPERATOR_DATA, { from: holder } ); - await assertRevert(tempToken.contract.methods.burn('15', userData).send({ from: holder })); + await shouldFail.reverting(tempToken.contract.methods.burn('15', userData).send({ from: holder })); }); }); }); @@ -841,7 +841,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { ); const opData = '0xbabecafe'; const userData = '0xdeadbeef'; - await assertRevert( + await shouldFail.reverting( tempToken.contract.methods.operatorBurn(holder, '100', userData, opData).send({ from: anotherAccount }) ); }); @@ -876,7 +876,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { const amount = parseInt(INITIAL_SUPPLY, 10) + 100; const opData = '0xbabecafe'; const userData = '0xdeadbeef'; - await assertRevert( + await shouldFail.reverting( this.token.contract.methods.operatorBurn( holder, amount.toString(), @@ -934,7 +934,7 @@ contract('ERC777', function ([_, holder, operator, anotherAccount]) { OPERATOR_DATA, { from: holder } ); - await assertRevert( + await shouldFail.reverting( tempToken.contract.methods.operatorBurn(holder, '15', userData, opData).send({ from: operator }) ); }); diff --git a/test/helpers/expectEvent.js b/test/helpers/expectEvent.js index 5750157391e..3e8a29284d7 100644 --- a/test/helpers/expectEvent.js +++ b/test/helpers/expectEvent.js @@ -1,10 +1,8 @@ -const BigNumber = web3.utils.BN; -const should = require('chai') - .use(require('chai-bignumber')(BigNumber)) - .should(); +const { BN, should } = require('openzeppelin-test-helpers'); +const BigNumber = BN; function inEvents (events, eventName, eventArgs = {}) { - const _event = Object.values(events).find(function (e) { + const event = Object.values(events).find(function (e) { if (e.event === eventName) { for (const [k, v] of Object.entries(eventArgs)) { contains(e.returnValues, k, v); @@ -12,8 +10,8 @@ function inEvents (events, eventName, eventArgs = {}) { return true; } }); - should.exist(_event); - return _event; + should.exist(event); + return event; } function inLogs (logs, eventName, eventArgs = {}) { diff --git a/test/introspection/ERC1820Deploy.js b/test/introspection/ERC1820Deploy.js index 9482935b2ef..233b61806f7 100644 --- a/test/introspection/ERC1820Deploy.js +++ b/test/introspection/ERC1820Deploy.js @@ -1,4 +1,4 @@ -const { sendEther } = require('../helpers/sendTransaction'); +const { send } = require('openzeppelin-test-helpers'); const ERC1820Deploy = async function (owner) { const deployAccount = '0x5808bA8E60E0367C9067b328D75C1f3d29de58cf'; @@ -6,7 +6,7 @@ const ERC1820Deploy = async function (owner) { const deployTx = '0xf90a388085174876e800830c35008080b909e5608060405234801561001057600080fd5b506109c5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c010000000000000000000000000000000000000000000000000000000090048063a41e7d5111610078578063a41e7d51146101d4578063aabbb8ca1461020a578063b705676514610236578063f712f3e814610280576100a5565b806329965a1d146100aa5780633d584063146100e25780635df8122f1461012457806365ba36c114610152575b600080fd5b6100e0600480360360608110156100c057600080fd5b50600160a060020a038135811691602081013591604090910135166102b6565b005b610108600480360360208110156100f857600080fd5b5035600160a060020a0316610570565b60408051600160a060020a039092168252519081900360200190f35b6100e06004803603604081101561013a57600080fd5b50600160a060020a03813581169160200135166105bc565b6101c26004803603602081101561016857600080fd5b81019060208101813564010000000081111561018357600080fd5b82018360208201111561019557600080fd5b803590602001918460018302840111640100000000831117156101b757600080fd5b5090925090506106b3565b60408051918252519081900360200190f35b6100e0600480360360408110156101ea57600080fd5b508035600160a060020a03169060200135600160e060020a0319166106ee565b6101086004803603604081101561022057600080fd5b50600160a060020a038135169060200135610778565b61026c6004803603604081101561024c57600080fd5b508035600160a060020a03169060200135600160e060020a0319166107ef565b604080519115158252519081900360200190f35b61026c6004803603604081101561029657600080fd5b508035600160a060020a03169060200135600160e060020a0319166108aa565b6000600160a060020a038416156102cd57836102cf565b335b9050336102db82610570565b600160a060020a031614610339576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b6103428361092a565b15610397576040805160e560020a62461bcd02815260206004820152601a60248201527f4d757374206e6f7420626520616e204552433136352068617368000000000000604482015290519081900360640190fd5b600160a060020a038216158015906103b85750600160a060020a0382163314155b156104ff5760405160200180807f455243313832305f4143434550545f4d4147494300000000000000000000000081525060140190506040516020818303038152906040528051906020012082600160a060020a031663249cb3fa85846040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182600160a060020a0316600160a060020a031681526020019250505060206040518083038186803b15801561047e57600080fd5b505afa158015610492573d6000803e3d6000fd5b505050506040513d60208110156104a857600080fd5b5051146104ff576040805160e560020a62461bcd02815260206004820181905260248201527f446f6573206e6f7420696d706c656d656e742074686520696e74657266616365604482015290519081900360640190fd5b600160a060020a03818116600081815260208181526040808320888452909152808220805473ffffffffffffffffffffffffffffffffffffffff19169487169485179055518692917f93baa6efbd2244243bfee6ce4cfdd1d04fc4c0e9a786abd3a41313bd352db15391a450505050565b600160a060020a03818116600090815260016020526040812054909116151561059a5750806105b7565b50600160a060020a03808216600090815260016020526040902054165b919050565b336105c683610570565b600160a060020a031614610624576040805160e560020a62461bcd02815260206004820152600f60248201527f4e6f7420746865206d616e616765720000000000000000000000000000000000604482015290519081900360640190fd5b81600160a060020a031681600160a060020a0316146106435780610646565b60005b600160a060020a03838116600081815260016020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169585169590951790945592519184169290917f605c2dbf762e5f7d60a546d42e7205dcb1b011ebc62a61736a57c9089d3a43509190a35050565b600082826040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012090505b92915050565b6106f882826107ef565b610703576000610705565b815b600160a060020a03928316600081815260208181526040808320600160e060020a031996909616808452958252808320805473ffffffffffffffffffffffffffffffffffffffff19169590971694909417909555908152600284528181209281529190925220805460ff19166001179055565b600080600160a060020a038416156107905783610792565b335b905061079d8361092a565b156107c357826107ad82826108aa565b6107b85760006107ba565b815b925050506106e8565b600160a060020a0390811660009081526020818152604080832086845290915290205416905092915050565b6000808061081d857f01ffc9a70000000000000000000000000000000000000000000000000000000061094c565b909250905081158061082d575080155b1561083d576000925050506106e8565b61084f85600160e060020a031961094c565b909250905081158061086057508015155b15610870576000925050506106e8565b61087a858561094c565b909250905060018214801561088f5750806001145b1561089f576001925050506106e8565b506000949350505050565b600160a060020a0382166000908152600260209081526040808320600160e060020a03198516845290915281205460ff1615156108f2576108eb83836107ef565b90506106e8565b50600160a060020a03808316600081815260208181526040808320600160e060020a0319871684529091529020549091161492915050565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff161590565b6040517f01ffc9a7000000000000000000000000000000000000000000000000000000008082526004820183905260009182919060208160248189617530fa90519096909550935050505056fea165627a7a723058207d33f0c34a1016c7fcf5f8547cd8c09a74f837ed2564550f647531f1128056ec00291ba01820182018201820182018201820182018201820182018201820182018201820a01820182018201820182018201820182018201820182018201820182018201820'; // send 0.08 ether to deployment account - sendEther(owner, deployAccount, web3.utils.toWei('0.08', 'ether')); + send.ether(owner, deployAccount, web3.utils.toWei('0.08', 'ether')); // create ERC1820 contract const address = (await web3.eth.sendSignedTransaction(deployTx)).contractAddress; return address;