It’s been a few weeks since we started publishing and keeping logs on Acryptos.com timelock. Many are still confused about how our parser and the underlying smart contract decodes such transactions.
In response to various requests, here’s a detailed ‘howto’ that should decode most of the timelock transactions within the various EVM compatible chains (Ethereum, Binance Smart Chain for example)
We take this sample transaction as an example :
Types of Timelock transaction
These are the 2 common transactions :
- queueTransaction()
- executeTransaction()
As executeTransaction() actions previously queued requests, we are only interested in the queueTransaction().
Decoding queueTransaction()
The decoded queueTransaction() split the Input Data into the following:
We’re interested in the following field :
target: 96c8390ba28eb083a784280227c37b853bc408b7
(which is ACSI Farm Contract)
data: 64482f79000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000
Decoding data field
- Identify the function call
Take the first 8 hexadecimal number of the data and look up at such lookup database like 4bytes.directory, which covers 95% of the function signatures. (I’ve my own method for those odd ball, complicated)
https://www.4byte.directory/signatures/?bytes4_signature=64482f79
the lookup decodes the function to :
set(uint256, uint256, bool)
which takes 3 inputs.
2. Split the inputs
Split the data to the following :
64482f79
0000000000000000000000000000000000000000000000000000000000000002
00000000000000000000000000000000000000000000000000000000000001f4
0000000000000000000000000000000000000000000000000000000000000000
which translates to
input 1: 0000000000000000000000000000000000000000000000000000000000000002
input 2:
00000000000000000000000000000000000000000000000000000000000001f4
input 3:
0000000000000000000000000000000000000000000000000000000000000000
3. Convert the inputs from hexadecimal to decimal
https://www.binaryhexconverter.com/hex-to-decimal-converter
input 1: 2
input 2: 500
input 3: 0
4. Interpret the function
The set function now reads
set(2, 500, 0)
which from the ACSI Farm Contract we get to know that this action involved setting the pool weight for pid=2 with 500 allocPoint
(500 allocPoints means 500/100 = 5x)
https://bscscan.com/address/0x96c8390ba28eb083a784280227c37b853bc408b7#writeContract (DO NOT CLICK WRITE!!)
5. Identify pool id 2
Use the ACSI Farm Contract (read contract), use item 12. poolinfo to query for pool id 2.
From there we found pool2 = 0xEb7Dc7b3bfF60A450EfF31Edf1330355361EA5ad
which is ACS4VAI
6. Decoded
We have decoded the timelock to read
set(ACS4VAI pool, 5x, 0)
which determines that the timelock action is to change the pool ACS4VAI to 5x multiplier for farm reward.
Exceptions
There are exceptions that might hinder your decoding process:
- New functions yet to be populated within 4bytes directory
- function name clashes within 4bytes directory, means only the first one get recorded
for example:
set(uint256, uint256, bool) vs
set(uint256, uint256, uint256)
Also, Read
- Learn about Ethereum and Web3
- Crypto Trading Bot
- 3Commas Review
- AAX Exchange Review | Referral Code, Trading Fee, Pros and Cons
- Deribit Review | Options, Fees, APIs and Testnet
- FTX Crypto Exchange Review
- NGRAVE ZERO review
- Bybit Exchange Review
- 3Commas vs Cryptohopper
- The Best Bitcoin Hardware wallet
- Crypto Copy Trading Platforms
- Best monero wallet
- ledger nano s vs x
- Bitsgap vs 3Commas vs Quadency
- The Best Crypto Tax Software
- Best Crypto Trading Platforms
- Best Crypto Lending Platforms
- Ledger Nano S vs Trezor one vs Trezor T vs Ledger Nano X
- BlockFi vs Celsius vs Hodlnaut
- Bitsgap review — A Crypto Trading Bot That Makes Easy Money
- Quadency Review- A Crypto Trading Bot Made For Professionals
- PrimeXBT Review | Leverage Trading, Fee and Covesting
- Altrady review
- Ellipal Titan Review
- SecuX Stone Review
- BlockFi Review | Earn up to 8.6% interests on your Crypto
- Coinrule review
- Best Blockchain Analysis Tools
- Crypto arbitrage guide: How to make money as a beginner
- Best Crypto Charting Tool
- What are the best books to learn about Bitcoin?