description |
---|
How to verify oSnap Proposals |
oSnap uses the ASSERT_TRUTH
identifier can be found here. ASSERT_TRUTH
is intended to be used as a default price identifier for UMA's Optimistic Oracle V3 contract that allows asserters to make claims about the state of the world.
Price settlement can happen only in one of two ways:
- Return the 1 value if the claim is true.
- Return the 0 value if the claim is false or cannot be resolved.
Part 1: Snapshot Proposal Created
When a Snapshot proposal is created, a Discord ticket is created with a Tenderly simulation of the transaction payload. Here is an example:
The main objective of verifying the Snapshot proposal before voting is to ensure:
- The transaction payload can be executed
- Comparing the intent of the proposal against the transaction payload
- The transaction payload doesn't have any unintended consequences or malicious intent
In the Tenderly simulation, if the Status
value is not Success
, that is an indicator the transaction payload is unable to be executed and requires further review.
The input shows the transactions array that will be executed if the Snapshot proposal passes:
Verifying the transaction data
- Go to https://lab.miguelmota.com/ethereum-input-data-decoder/example/.
- Input the contract ABI into the ABI section
- Take the ‘to’ value from the transaction object and input it into etherscan (or the block explorer based on the chainID. For etherscan, you would go to https://etherscan.io/address/{to}.
- Click the ‘contract’ tab
- Scroll down to the ‘Contract ABI’ section and copy everything
- Paste it into the ABI section
Here is what the example would look like:
The ‘Output’ for a Transfer should look as the below:
{
"method": "transfer",
"types": [
"address",
"uint256"
],
"inputs": [
"9040e41eF5E8b281535a96D9a48aCb8cfaBD9a48",
{
"type": "BigNumber",
"hex": "0x14adf4b7320334b9000000"
}
],
"names": [
"to",
"amount"
]
}
Verify the following:
- For any BigNumber values, go to https://playground.ethers.org/ and input
BigNumber.from("{INPUT_VALUE}").toString()
. For example,BigNumber.from("0x14adf4b7320334b9000000").toString()
would be25000000000000000000000000
. To scale this value, go to the token contract address and check decimals. For the ACX token, the decimals are 18 so the scaled value is25000000
. You can use https://eth-converter.com/ if the decimals are 18. - Confirm that the above value is mentioned in the actual Snapshot proposal.
- Search for the token in coingecko.com with the token address and confirm there is liquidity.
Part 2: oSnap Transactions Proposed
After a Snapshot proposal is completed, if the proposal is valid the transactions are proposed which creates another Discord ticket. Here is an example thread in the UMA Discord.
The first objective is to verify the oSnap rules against Snapshot Proposal. Click the Snapshot space URL, in the above example that is https://snapshot.org/#/acrossprotocol.eth. Go through the list of proposals and confirm the explanation from the Discord message matches the Snapshot space.
Validators should do the following to verify the oSnap proposal:
- Check the Snapshot space referenced in the rules string.
- Check that the IPFS hash passed as the explanation lines up with an actual vote in that Snapshot space. They should be able to cross-reference the value with a link from a specific Snapshot proposal.
- Check the Snapshot proposal tied to the IPFS explanation value met the minimum voting period and quorum.
- Check that the Snapshot proposal passed according to the Snapshot strategy.
Compare Snapshot IPFS Transaction data against Proposed Transactions
- Go to the Snapshot proposal and click the ‘View Details’ link in the Transactions container:
- Copy the “transactions” array into https://jsonformatter.org/. You should use Firefox or Brave so that backslashes “\” aren’t included in the array which will give you an error message when trying to parse:
3. In the Discord post, click the transaction:’
Then copy the ‘Transaction Hash’:
Go to https://dashboard.tenderly.co/ and paste the ‘Transaction Hash’. Then click ‘Show’ to check the input data.
In the Discord Ticket, paste the screenshots of Tenderly and json formatter and also paste the transaction data into another thread message as below:
Tenderly:
[
{
"to": "0x44108f0223a3c3028f5fe7aec7f9bb2e66bef82f",
"operation": 0,
"value": "0",
"data": "0xa9059cbb0000000000000000000000009040e41ef5e8b281535a96d9a48acb8cfabd9a4800000000000000000000000000000000000000000014adf4b7320334b9000000"
}
]
Snapshot IPFS:
[
{
"operation": "0",
"data": "0xa9059cbb0000000000000000000000009040e41ef5e8b281535a96d9a48acb8cfabd9a4800000000000000000000000000000000000000000014adf4b7320334b9000000",
"to": "0x44108f0223A3C3028F5Fe7AEC7f9bb2E66beF82F",
"value": "0"
}
]
The following should be verified:
- ‘data’ from Tenderly matches the transaction data from Snapshot.
- ‘value’ from Tenderly matches the transaction data from Snapshot.
- ‘to’ from Tenderly matches the transaction data from Snapshot.
- Verify the explanation:
- Go to https://playground.ethers.org/ and input the following explanation to ethers.utils.toUtf8String(“{explanation}”).toString()
- Take the returned value and input it into the following url ‘https://snapshot.4everland.link/ipfs/{explanation} and verify that the data matches from Snapshot