-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: curve incentives script #1540
base: main
Are you sure you want to change the base?
Conversation
Reading
Data LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirmed the addys in the book ✅
experiencing the same re invalid opcode
locally and probably it is related to funny synergy between brownie<>ganache version
since the operation is relatively straightforward if this becomes a blocker will be supportive of leveraging the json file as it is easy to audit only 2 actions imo + easy to DD with the tenderly sim ✅
dripping rate will be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im als getting invalid opcode
. it is probably due to brownie/ganache still being on the istanbul evm version, and missing some since then newly introduced opcodes
in these cases where we rely on the tx json instead, i think it would be good to include it in the pr as well
@petrovska-petro @gosuto-inzasheru, the JSON file for the operation, along with some instructions was pushed as per your suggestion. Also added Decimal instead of float, just in case. |
@@ -22,7 +28,7 @@ def main(amount=0, epoch=MONTH, use_wsteth=True): | |||
""" | |||
safe = GreatApeSafe(TROPS) | |||
gauge = safe.contract(GAUGE, Interface=interface.ILiquidityGaugeV6) | |||
amount = int(float(amount) * 1e18) | |||
amount = int(Decimal(amount) * 1e18) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you test this? i dont think you can multiply a Decimal
with a non Decimal
type:
>>> int(Decimal(4.22)*1e18)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'decimal.Decimal' and 'float'
ok i was able to run this successfully in an updated env that uses brownie v1.20.5, a custom version of brownie-safe and ganache v7 running the shanghai fork:
as a test i posted it through my delegate which looks to be successful too: https://app.safe.global/transactions/tx?safe=eth:0x042B32Ac6b453485e357938bdC38e0340d4b9276&id=multisig_0x042B32Ac6b453485e357938bdC38e0340d4b9276_0x3f4be8f7233c128790d8aa6f6e2f072ffb3c7f2a299745f996a1335c0d6775df |
"contractInputsValues": { | ||
"_reward_token": "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0", | ||
"_amount": "4220000000000000000", | ||
"_epoch": "2419200" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice adding the json file ✅
before posting it w/ either method json or working env worth having clarity of the final arguments for deposit_reward_token
based on latest convos and then post in the pr the official json filed which will get posted
Tackles #1539
Run with:
Can optionally take a different epoch, defaults to 1 month.
NOTE:
@petrovska-petro @gosuto-inzasheru, I keep getting the following error:
Tested the same transaction via Tenderly, and it worked. I confirmed that the call_data is correct by encoding it through the script and comparing it to Tenderly's (
0x33b50aed0000000000000000000000007f39c581f595b53c5cb19bd0b3f8da6c935e2ca00000000000000000000000000000000000000000000000003a9073a438260000000000000000000000000000000000000000000000000000000000000024ea00
). Attempting to call it normally or by passing the calldata directly returns the same error. I am inclined to believe that this is one of those obscure Brownie issues.Please let me know if it works from your side.
Alternative
The following JSON represents a batch of the approval and deposit and can be imported to the Gnosis Safe UI. It could be re-used on a monthly basis and the amount to approve and deposit can be adjusted through the UI. At least while we figure out how to fix the script.
Lido incentives.json