def main(): print(network.show_active()) network.gas_limit(10000000) accounts.add(os.environ['METAMASK_SECRET_KEY']) accounts.default = accounts[1] ERC20.deploy(69000, 'ELMO', {'from': accounts.default})
def main(): accounts.from_mnemonic(SEED) admin = accounts[0] token = ERC20CRV.deploy("Curve DAO Token", "CRV", 18, {'from': admin, 'required_confs': confs}) voting_escrow = VotingEscrow.deploy( token, "Vote-escrowed CRV", "veCRV", "veCRV_1.0.0", {'from': admin, 'required_confs': confs} ) coin_a = ERC20.deploy("Coin A", "USDA", 18, {'from': admin, 'required_confs': confs}) coin_b = ERC20.deploy("Coin B", "USDB", 18, {'from': admin, 'required_confs': confs}) coin_a._mint_for_testing(10 ** 9 * 10 ** 18, {'from': admin, 'required_confs': confs}) coin_b._mint_for_testing(10 ** 9 * 10 ** 18, {'from': admin, 'required_confs': confs}) lp_token = ERC20LP.deploy("Some pool", "cPool", 18, 0, {'from': admin, 'required_confs': confs}) pool = CurvePool.deploy([coin_a, coin_b], lp_token, 100, 4 * 10 ** 6, {'from': admin, 'required_confs': confs}) lp_token.set_minter(pool, {'from': admin, 'required_confs': confs}) coin_a.approve(pool, "1000000000000000000000", {'from': admin}) coin_b.approve(pool, "1000000000000000000000", {'from': admin}) pool.add_liquidity(["100000000000000", "200000000000000"], 0, {'from': admin}) contract = CurveRewards.deploy(lp_token, coin_a, {'from': accounts[0], 'required_confs': confs}) contract.setRewardDistribution(accounts[0], {'from': accounts[0], 'required_confs': confs}) registry = Registry.deploy([ZERO_ADDRESS] * 4, {'from': admin, 'required_confs': confs}) coin_a.transfer(contract, 100e18, {'from': accounts[0], 'required_confs': confs}) liquidity_gauge_rewards = LiquidityGaugeReward.deploy(lp_token, '0xbE45e0E4a72aEbF9D08F93E64701964d2CC4cF96', contract, coin_a, {'from': admin, 'required_confs': confs}) for account in DISTRIBUTION_ADDRESSES: coin_a.transfer(account, DISTRIBUTION_AMOUNT, {'from': admin, 'required_confs': confs}) coin_b.transfer(account, DISTRIBUTION_AMOUNT, {'from': admin, 'required_confs': confs}) pool.commit_transfer_ownership(ARAGON_AGENT, {'from': admin, 'required_confs': confs}) pool.apply_transfer_ownership({'from': admin, 'required_confs': confs}) registry.commit_transfer_ownership(ARAGON_AGENT, {'from': admin, 'required_confs': confs}) registry.apply_transfer_ownership({'from': admin, 'required_confs': confs}) gauge_controller = GaugeController.deploy(token, voting_escrow, {'from': admin, 'required_confs': confs}) minter = Minter.deploy(token, gauge_controller, {'from': admin, 'required_confs': confs}) liquidity_gauge = LiquidityGauge.deploy(lp_token, minter, {'from': admin, 'required_confs': confs}) token.set_minter(minter, {'from': admin, 'required_confs': confs}) gauge_controller.add_type(b'Liquidity', {'from': admin, 'required_confs': confs}) gauge_controller.change_type_weight(0, 10 ** 18, {'from': admin, 'required_confs': confs}) gauge_controller.add_gauge(liquidity_gauge, 0, 10 ** 18, {'from': admin, 'required_confs': confs}) gauge_controller.commit_transfer_ownership(ARAGON_AGENT, {'from': admin, 'required_confs': confs}) gauge_controller.apply_transfer_ownership({'from': admin, 'required_confs': confs}) voting_escrow.commit_transfer_ownership(ARAGON_AGENT, {'from': admin, 'required_confs': confs}) voting_escrow.apply_transfer_ownership({'from': admin, 'required_confs': confs}) PoolProxy.deploy({'from': admin, 'required_confs': confs})
def main(): admin = accounts[0] token = ERC20.deploy("StakeWise", "SWISE", 18, {"from": admin}) template = VestingEscrowSimple.deploy({"from": admin}) factory = VestingEscrowFactory.deploy(template, admin, {"from": admin}) total_amount = sum(sum(x["recipients"].values()) for x in VESTING_ESCROWS) token._mint_for_testing(total_amount) token.approve(factory, total_amount) for x in VESTING_ESCROWS: for recipient, amount in x["recipients"].items(): tx = factory.deploy_vesting_contract( token, recipient, amount, x["duration"], x["start"], x["cliff"], ) escrow = VestingEscrowSimple.at(tx.new_contracts[0]) assert token.balanceOf(escrow) == amount assert escrow.recipient() == recipient print(f"progress {escrow.unclaimed() / escrow.total_locked():.3%}") print("locked", escrow.locked().to("ether")) print("unclaimed", escrow.unclaimed().to("ether")) escrow.claim({"from": escrow.recipient()}) print("tokens of recipient", token.balanceOf(recipient).to("ether"))
def main(): acct = accounts.load('deployment_account') erc20 = ERC20.deploy("Base Token", "BASE", 18, 200e18, {'from': acct}) #print(erc20.address) fdt_erc20 = FundsDistributionTokenERC20.deploy({'from': acct}) fdt_erc20_factory = FundsDistributionTokenERC20Factory.deploy( fdt_erc20, acct, erc20.address, {'from': acct}) # FundsDistributionToken.deploy('Musicakes', 'MCAKES', 0, 100, {'from': acct}) '''
def main(): acct = accounts.load('deployment_account') erc20 = ERC20.deploy("Base Token", "BASE", 18, 200e18, {'from': acct}) #print(erc20.address) fg = FeeGovernor.deploy(1e8, {'from': acct}) fgp = FeeGovernorProxy.deploy(fg.address, {'from': acct}) fdt_erc20_wf = FundsDistributionTokenERC20WithFee.deploy({'from': acct}) fdt_erc20_wf_factory = FundsDistributionTokenERC20WithFeeFactory.deploy( fdt_erc20_wf, acct, erc20.address, fgp.address, {'from': acct}) # FundsDistributionToken.deploy('Musicakes', 'MCAKES', 0, 100, {'from': acct}) '''
def main(): #acct = accounts.load('deployment_account') acct = accounts[0] # Deploy payment token erc20 = ERC20.deploy("Base Token", "BASE", 18, 200e18, {'from': acct}) # Deploy PaymentTokenGovernor and PaymentTokenGovernorProxy, # then add payment token to PaymentTokenGovernor payment_token_governor = PaymentTokenGovernor.deploy({'from': acct}) payment_token_governor_proxy = PaymentTokenGovernorProxy.deploy( payment_token_governor.address, {'from': acct}) add_payment_token_to_governor = PaymentTokenGovernor[0].add_payment_token( erc20.address, {'from': acct}) # Deploy FeeGovernor with 1% fee and FeeGovernorProxy fee_governor = FeeGovernor.deploy(1e8, {'from': acct}) fee_governor_proxy = FeeGovernorProxy.deploy(fee_governor.address, {'from': acct}) fdt_multi_erc20_wf = FundsDistributionTokenMultiERC20WithFee.deploy( {'from': acct}) fdt_multi_erc20_wf_factory = FundsDistributionTokenMultiERC20WithFeeFactory.deploy( fdt_multi_erc20_wf, acct, payment_token_governor_proxy.address, fee_governor_proxy.address, {'from': acct}) # FundsDistributionToken.deploy('Musicakes', 'MCAKES', 0, 100, {'from': acct}) tx = fdt_multi_erc20_wf_factory.deploy_fdt_contract( 'Musicakes', 'MCAKES', 0, 100) fdt_instance = FundsDistributionTokenMultiERC20WithFee.at( tx.new_contracts[0]) print("Address of Musicakes instance: " + str(fdt_instance))
def NewPaymentToken(ERC20, accounts): yield ERC20.deploy(NEW_PAYMENT_TOKEN_NAME, NEW_PAYMENT_TOKEN_SYMBOL, NEW_PAYMENT_TOKEN_DECIMALS, NEW_PAYMENT_TOKEN_SUPPLY, {'from': accounts[0]})
def meta_lp_token(alice): return ERC20.deploy("MetaTest Token", "MTST", 18, {"from": alice})