Add default sink address to constructor

This commit is contained in:
nolash 2021-02-05 09:44:15 +01:00
parent 65b51bc2a1
commit 7122fc280b
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 7 additions and 2 deletions

View File

@ -40,12 +40,15 @@ class Test(unittest.TestCase):
self.abi = json.load(f)
f.close()
backend = eth_tester.PyEVMBackend(eth_params)
self.eth_tester = eth_tester.EthereumTester(backend)
provider = web3.Web3.EthereumTesterProvider(self.eth_tester)
self.w3 = web3.Web3(provider)
self.sink_address = self.w3.eth.accounts[9]
c = self.w3.eth.contract(abi=self.abi, bytecode=self.bytecode)
tx_hash = c.constructor('Foo Token', 'FOO', 6, TAX_LEVEL, PERIOD).transact({'from': self.w3.eth.accounts[0]})
tx_hash = c.constructor('Foo Token', 'FOO', 6, TAX_LEVEL, PERIOD, self.sink_address).transact({'from': self.w3.eth.accounts[0]})
r = self.w3.eth.getTransactionReceipt(tx_hash)
self.contract = self.w3.eth.contract(abi=self.abi, address=r.contractAddress)

View File

@ -21,6 +21,8 @@ contract RedistributedDemurrageToken {
mapping (address => bool) minter;
mapping (address => mapping (address => uint256 ) ) allowance; // holder -> spender -> amount (amount is subject to demurrage)
address sinkAddress; // receives redistribuion remainders
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Mint(address indexed _minter, address indexed _beneficiary, uint256 _value);
@ -28,7 +30,7 @@ contract RedistributedDemurrageToken {
event Taxed(uint256 indexed _period);
event Redistribution(address indexed _account, uint256 indexed _period, uint256 _value);
constructor(string memory _name, string memory _symbol, uint8 _decimals, uint32 _taxLevel, uint256 _period) {
constructor(string memory _name, string memory _symbol, uint8 _decimals, uint32 _taxLevel, uint256 _period, address _defaultSinkAddress) {
owner = msg.sender;
minter[owner] = true;
periodStart = block.number;