Skip to content

Commit

Permalink
added withdraw-vested-tokens.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshowlett977 committed Jun 11, 2021
1 parent b28d5cf commit b48d55e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions scripts/deployment/distribution/withdraw-vested-tokens.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from brownie import *

import json

def main():
thisNetwork = network.show_active()

# == Load config =======================================================================================================================
if thisNetwork == "development":
acct = accounts[0]
configFile = open('./scripts/contractInteraction/testnet_contracts.json')
elif thisNetwork == "testnet":
acct = accounts.load("rskdeployer")
configFile = open('./scripts/contractInteraction/testnet_contracts.json')
elif thisNetwork == "rsk-mainnet":
acct = accounts.load("rskdeployer")
configFile = open('./scripts/contractInteraction/mainnet_contracts.json')
else:
raise Exception("network not supported")

# load deployed contracts addresses
contracts = json.load(configFile)

staking = Contract.from_abi("Staking", address=contracts['Staking'], abi=Staking.abi, owner=acct)
vestingRegistry = Contract.from_abi("VestingRegistry", address=contracts['VestingRegistry'], abi=VestingRegistry.abi, owner=acct)

vesting = vestingRegistry.getTeamVesting(acct)
print(vesting)

stakes = staking.getStakes(vesting)
print(stakes)

vestingLogic = Contract.from_abi("VestingLogic", address=vesting, abi=VestingLogic.abi, owner=acct)
vestingLogic.withdrawTokens(acct)

stakes = staking.getStakes(vesting)
print(stakes)

0 comments on commit b48d55e

Please sign in to comment.