gnosis / gp-v2-services

Off-chain services for Gnosis Protocol v2
Apache License 2.0
45 stars 15 forks source link

Generate Tenderly simulation on failed settlement simulations #422

Closed nlordell closed 3 years ago

nlordell commented 3 years ago

This issue captures the work to generate a Tenderly simulation on failed settlement simulations.

Luckily, its actually quite easy! Tenderly allows configuring a simulation with URL parameters. For example (note escaped newlines with \ for readability):

https://dashboard.tenderly.co/${organization}/${project}/simulator/new?\
block=8306882&\
blockIndex=0&\
from=0x0e1401b7037163764b161fd989bdcf224bb5dcc4&\
gas=8000000&\
gasPrice=0&\
value=0&\
contractAddress=0x4e608b7da83f8e9213f554bdaa77c72e125529d0&\
contractFunction=0x7caf7af0&\
functionInputs=%5B%220x6d7f0754ffeb405d23c51ce938289d4835be3b14%22%2C%220xd9ba894e0097f8cc2bbc9d24d308b98e36dc6d02%22%5D&\
functionInputs=%5B%2262688440296451781%22%2C%222500007499%22%5D&\
functionInputs=0x0100000000000000000000000000000000000000000000000eda9474d6355960d0ef0000000000000000000000000000000000000000000000000000001053ab84d3605ddeeaf6a005bd000000000000000000000000000000000000000000000000a1a1d4559a86e00000000000000000000000000000000000000000000000000eda9474d6355960d0ef00009c2a60b3405de291ca8826ec7e9cd44fdb74c4f8c6324f28801544fa858e2d8c80540fc186c12c4f9d1c1b838e9be39c0038b704acd0838870fca7e5363f8be1d7&\
functionInputs=0x7a250d5630b4cf539739df2c5dacb4c659f2488d00010438ed173900000000000000000000000000000000000000000000000000deb6cde764aec50000000000000000000000000000000000000000000000000000000094dcf0a300000000000000000000000000000000000000000000000000000000000000a00000000000000000000000004e608b7da83f8e9213f554bdaa77c72e125529d0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d9ba894e0097f8cc2bbc9d24d308b98e36dc6d020000000000000000000000006d7f0754ffeb405d23c51ce938289d4835be3b14&\
functionInputs=0x&\
network=4

Would open a new simulation with the specified parameters for the specified organization or account and project name (note that this requires first "adding" the settlement contract - which can be done by address as its already verified on Etherscan).

So a log message with these populated parameters would be enough! Easy! We just need a Gnosis org and a GPv2 project and this should be fairly trivial to add.

nlordell commented 3 years ago

For some super awesome wizardry :mage_man: click the following link

note: You have to have been added to the Gnosis Protocol v2 Tenderly organization

/cc @fleupold

fleupold commented 3 years ago

Follow up/Clean Up tasks