Beispiel #1
0
def test_init(chain, token, beneficiary):
    sale = deploy_contract(chain,
                           'ViewlySeedSale',
                           args=[token.address, beneficiary])

    assert is_same_address(sale.call().viewToken(), token.address)
    assert sale.call().beneficiary() == beneficiary
Beispiel #2
0
def instance(chain: BaseChain, token: Contract) -> Contract:
    contract = deploy_contract(chain, contract_name, args=[token.address])
    token.transact().setOwner(contract.address)
    return contract
Beispiel #3
0
def token(chain: BaseChain) -> Contract:
    """ The VIEW ERC-20 Token contract. """
    return deploy_contract(chain, 'DSToken', args=['VIEW'])
Beispiel #4
0
def sale(chain: BaseChain, token: Contract, beneficiary) -> Contract:
    """ A blank ViewlySeedSale contract. """
    args = [token.address, beneficiary]
    seed_sale = deploy_contract(chain, 'ViewlySeedSale', args=args)
    token.transact().setOwner(seed_sale.address)
    return seed_sale