Skip to content

Commit

Permalink
Merge pull request #254 from DistributedCollective/sip
Browse files Browse the repository at this point in the history
SIP0019
  • Loading branch information
Franklin Richards committed Jun 1, 2021
2 parents 2c83ba5 + ab14a5b commit 8f59cc2
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions scripts/sip/sip_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from brownie import *
from brownie.network.contract import InterfaceContainer
import json
import time;
import copy
import time

def main():

Expand All @@ -18,8 +17,7 @@ def main():

# Call the function you want here
currentVotingPower(acct)
createProposalSIP0017()
createProposalSIP0018()
createProposalSIP0019()

balanceAfter = acct.balance()

Expand Down Expand Up @@ -53,8 +51,8 @@ def hasApproval(tokenContractAddr, sender, receiver):
allowance = tokenContract.allowance(sender, receiver)
print("Allowance: ", allowance/1e18)

def checkIfUserHasToken(EAT, user):
tokenContract = Contract.from_abi("Token", address=EAT, abi=TestToken.abi, owner=user)
def checkIfUserHasToken(tokenAddr, user):
tokenContract = Contract.from_abi("Token", address=tokenAddr, abi=TestToken.abi, owner=user)
balance = tokenContract.balanceOf(user)
print("Token Balance: ", balance)

Expand All @@ -68,12 +66,12 @@ def currentVotingPower(acctAddress):
votingPower = staking.getCurrentVotes(acctAddress)
proposalThreshold = governor.proposalThreshold()

print('======================================')
print('=============================================================')
print('Your Address: '+str(acctAddress))
print('Your Token Balance: '+str(balance))
print('Your Voting Power: '+str(votingPower))
print('Proposal Threshold: '+str(proposalThreshold))
print('======================================')
print('=============================================================')

def queueProposal(id):
governor = Contract.from_abi("GovernorAlpha", address=contracts['GovernorOwner'], abi=GovernorAlpha.abi, owner=acct)
Expand All @@ -88,17 +86,18 @@ def executeProposal(id):
def createProposal(governorAddr, target, value, signature, data, description):
governor = Contract.from_abi("GovernorAlpha", address=governorAddr, abi=GovernorAlpha.abi, owner=acct)

print('======================================')
print('=============================================================')
print('Governor Address: '+governor.address)
print('Target: '+str(target))
print('Values: '+str(value))
print('Signature: '+str(signature))
print('Data: '+str(data))
print('Description: '+str(description))
print('======================================')
print('=============================================================')

# Create Proposal
# governor.propose(target, value, signature, data, description)
# tx = governor.propose(target, value, signature, data, description)
# tx.info()

def createProposalSIP0005():
dummyAddress = contracts['GovernorOwner']
Expand Down Expand Up @@ -200,3 +199,14 @@ def createProposalSIP0018():

# Create Proposal
createProposal(contracts['GovernorAdmin'], target, value, signature, data, description)

def createProposalSIP0019():
# Action
target = [contracts['SOV']]
value = [0]
signature = ["name()"]
data = ["0x"]
description = "SIP-0019: Exchequer Committee 2021 Budget, Details: https://github.com/DistributedCollective/SIPS/blob/2a3c5a7/SIP-0019.md, sha256: dfc958c3e84e7bbfb7d8f3e944fbd73ebc8f05dabd6fdd16b8c2884607c52b88"

# Create Proposal
createProposal(contracts['GovernorOwner'], target, value, signature, data, description)

0 comments on commit 8f59cc2

Please sign in to comment.