Skip to content

Commit

Permalink
extended v1 test on contract interaction script
Browse files Browse the repository at this point in the history
  • Loading branch information
ororopickpocket committed Apr 7, 2021
1 parent e9163fb commit 473a1df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion scripts/contractInteraction/contract_interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main():
testV1Converter(contracts["ConverterSOV"], contracts["WRBTC"], contracts["SOV"])
# transferSOVtoTokenSender()
# addLiquidityV1(contracts["WRBTCtoSOVConverter"], [contracts['WRBTC'], contracts['SOV']], [1 * 10**16, 67 * 10**18])
addLiquidityV1UsingWrapper(contracts["WRBTCtoSOVConverter"], [contracts['WRBTC'], contracts['SOV']], [1 * 10**16, 67 * 10**18])
#addLiquidityV1UsingWrapper(contracts["WRBTCtoSOVConverter"], [contracts['WRBTC'], contracts['SOV']], [1 * 10**16, 67 * 10**18])

def loadConfig():
global contracts, acct
Expand Down Expand Up @@ -1120,6 +1120,16 @@ def testV1Converter(converterAddress, reserve1, reserve2):
print('difference:', accountBalance - newAccountBalance)
print('expected differnce:', bal2/100)

addLiquidityV1UsingWrapper(converterAddress, [reserve1, reserve2], [bal1/100, bal2/50])

newerAccountBalance = tokenContract2.balanceOf(acct)
print('difference:', newAccountBalance - newerAccountBalance)
print('expected differnce:', bal2/100)

balanceOnProxy = tokenContract2.balanceOf(contracts['RBTCWrapperProxy'])
print('balance on proxy contract after the interaction: ', balanceOnProxy)


def addLiquidityV1(converter, tokens, amounts):
abiFile = open('./scripts/contractInteraction/LiquidityPoolV1Converter.json')
abi = json.load(abiFile)
Expand Down
2 changes: 1 addition & 1 deletion scripts/contractInteraction/testnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"VestingLogic": "0xc1cECAC06c7a5d5480F158043A150acf06e206cD",
"OriginInvestorsClaim": "0x9FBe4Bf89521088F790a4dD2F3e495B4f0dA7F42",

"TokenSender": "0x4D1903BaAd894Fc6Ff70483d8518Db78F163F9ff"
"TokenSender": "0x4D1903BaAd894Fc6Ff70483d8518Db78F163F9ff",

"WRBTCtoSOVConverter": "0x38729759415b27F70D5ca91CE357c45214B95Cf4",
"RBTCWrapperProxy": "0xFFB9470e0B11aAC25a331D8E6Df557Db6c3c0c53"
Expand Down

0 comments on commit 473a1df

Please sign in to comment.