Skip to content

Conversation

@aalavandhan
Copy link
Member

New helper script does to calculate the amount of ampl required to rollover the entire SPOT supply.

It also generates a Batch.json file which can be uploaded into Gnosis safe to automatically populate the transaction values.
(PSA: do not trust the script, always double check before submitting any transaction)

yarn hardhat --network goerli ops:preview_tx:trancheAndRollover \
  --wallet-address [WALLET] \
  --router-address 0x5e902bdCC408550b4BD612678bE2d57677664Dc9 \
  --perp-address 0x95014Bc18F82a98CFAA3253fbD3184125A01f848
# example output
---------------------------------------------------------------
Rollover preview
balanceAvailable 56004638.766259293
collateralUsed 2207.073339441
rolloverAmt 1101.890069575
---------------------------------------------------------------
collateralToken 0x74567107828843070087F1c6ec8322A3e8450725
router 0x5e902bdCC408550b4BD612678bE2d57677664Dc9
perp 0x95014Bc18F82a98CFAA3253fbD3184125A01f848
depositBond 0xF602e4689fFB5B88EcdDd99C23ddBC95aC98934c
collateralAmountFixedPt 2207073339441
rolloverData [
  [
    "0xE6C7c644B4aEb4424aA9561a4d6bD0AE7c6935c7",
    "0x74567107828843070087F1c6ec8322A3e8450725",
    "1103536669720"
  ]
]
rolloverFeeFixedPt 0
---------------------------------------------------------------
Execute the following transactions
{
  to: '0x74567107828843070087F1c6ec8322A3e8450725',
  method: 'approve',
  args: [ '0x5e902bdCC408550b4BD612678bE2d57677664Dc9', '2207073339441' ]
}
{
  to: '0x5e902bdCC408550b4BD612678bE2d57677664Dc9',
  method: 'trancheAndRollover',
  args: [
    '0x95014Bc18F82a98CFAA3253fbD3184125A01f848',
    '0xF602e4689fFB5B88EcdDd99C23ddBC95aC98934c',
    '2207073339441',
    '[["0xE6C7c644B4aEb4424aA9561a4d6bD0AE7c6935c7","0x74567107828843070087F1c6ec8322A3e8450725","1103536669720"]]',
    '0'
  ]
}
Wrote tx batch to file: RolloverBatch.json

@aalavandhan aalavandhan merged commit 004a684 into main Feb 3, 2023
@aalavandhan aalavandhan deleted the multisig-helper branch February 3, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants