How to decode timelock
Tags: ethereum, binancesmartchain, acryptos, smartcontractblockch
Published: 2021-01-07 08:19:52

---
title: How to decode timelock
published: true
date: 2020-12-28 07:04:05 UTC
tags: ethereum,binancesmartchain,acryptos,smartcontractblockch
canonical_url: https://medium.com/coinmonks/how-to-decode-timelock-738b3e5eec4c
---

![](https://cdn-images-1.medium.com/max/668/1*AYt1J7fwWDK9ssNE_gEZeQ.jpeg)

It’s been a few weeks since we started publishing and keeping logs on [Acryptos.com timelock](https://getunrekt.medium.com/acs-timelock-transaction-log-d084a735c95a). 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 :_

[Binance Transaction Hash (Txhash) Details | BscScan](https://bscscan.com/tx/0x3f6462edd7249dd0cbf4b155aa3dbf5a7fc18a084b368b05c6357cfb37d8a1ee)

### 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()**.

![](https://cdn-images-1.medium.com/max/1024/1*NQ8ingz6TQzh41QcfPsLXg.png)<figcaption>sample queueTransaction().</figcaption>

### Decoding queueTransaction()

The decoded queueTransaction() split the _Input Data_ into the following:

![](https://cdn-images-1.medium.com/max/964/1*eCi4PBS_NSkN_F8ZfmoSdA.png)

We’re interested in the following field :

**target** : [96c8390ba28eb083a784280227c37b853bc408b7](https://bscscan.com/address/0x96c8390ba28eb083a784280227c37b853bc408b7)

(which is ACSI Farm Contract)

**data** : 64482f79000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000000000

### Decoding data field

1. **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](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](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](https://bscscan.com/address/0x96c8390ba28eb083a784280227c37b853bc408b7#writeContract) (DO NOT CLICK WRITE!!)

![](https://cdn-images-1.medium.com/max/327/1*0-y2d3qtPJ2rbBSBCgWLBQ.png)

**5. Identify pool id 2**

Use the [ACSI Farm Contract](https://bscscan.com/address/0x96c8390ba28eb083a784280227c37b853bc408b7#readContract) (read contract), use item _12. poolinfo_ to query for pool id 2.

From there we found pool2 = **_0xEb7Dc7b3bfF60A450EfF31Edf1330355361EA5ad_**

which is  **ACS4VAI**

![](https://cdn-images-1.medium.com/max/612/1*CVeSCwUaNpje5s1Fb4CNGQ.png)

**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](https://blog.coincodecap.com/go/learn)
- [Crypto Trading Bot](https://medium.com/coinmonks/whats-the-best-crypto-trading-bot-in-2020-top-8-bitcoin-trading-bot-c16adeb13317)
- [3Commas Review](https://medium.com/coinmonks/3commas-review-an-excellent-crypto-trading-bot-2020-1313a58bec92)
- [AAX Exchange Review](https://medium.com/coinmonks/aax-exchange-review-2021-67c5ea09330c) | Referral Code, Trading Fee, Pros and Cons
- [Deribit Review](https://medium.com/coinmonks/deribit-review-options-fees-apis-and-testnet-2ca16c4bbdb2) | Options, Fees, APIs and Testnet
- [FTX Crypto Exchange Review](https://medium.com/coinmonks/ftx-crypto-exchange-review-53664ac1198f)
- [NGRAVE ZERO review](https://medium.com/coinmonks/ngrave-zero-review-c465cf8307fc)
- [Bybit Exchange Review](https://medium.com/coinmonks/bybit-exchange-review-dbd570019b71)
- [3Commas vs Cryptohopper](https://medium.com/coinmonks/cryptohopper-vs-3commas-vs-shrimpy-a2c16095b8fe)
- The Best Bitcoin [Hardware wallet](https://medium.com/coinmonks/the-best-cryptocurrency-hardware-wallets-of-2020-e28b1c124069?source=friends_link&sk=324dd9ff8556ab578d71e7ad7658ad7c)
- [Crypto Copy Trading Platforms](https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c)
- Best [monero wallet](https://blog.coincodecap.com/best-monero-wallets)
- [ledger nano s vs x](https://blog.coincodecap.com/ledger-nano-s-vs-x)
- [Bitsgap vs 3Commas vs Quadency](https://blog.coincodecap.com/bitsgap-3commas-quadency)
- The Best [Crypto Tax Software](https://medium.com/coinmonks/best-crypto-tax-tool-for-my-money-72d4b430816b)
- [Best Crypto Trading Platforms](https://medium.com/coinmonks/the-best-crypto-trading-platforms-in-2020-the-definitive-guide-updated-c72f8b874555)
- Best [Crypto Lending Platforms](https://medium.com/coinmonks/top-5-crypto-lending-platforms-in-2020-that-you-need-to-know-a1b675cec3fa)
- [Ledger Nano S vs Trezor one vs Trezor T vs Ledger Nano X](https://blog.coincodecap.com/ledger-nano-s-vs-trezor-one-ledger-nano-x-trezor-t)
- [BlockFi vs Celsius](https://medium.com/coinmonks/blockfi-vs-celsius-vs-hodlnaut-8a1cc8c26630) vs Hodlnaut
- [Bitsgap review](https://medium.com/coinmonks/bitsgap-review-a-crypto-trading-bot-that-makes-easy-money-a5d88a336df2) — A Crypto Trading Bot That Makes Easy Money
- [Quadency Review](https://medium.com/coinmonks/quadency-review-a-crypto-trading-automation-platform-3068eaa374e1)- A Crypto Trading Bot Made For Professionals
- [PrimeXBT Review](https://medium.com/coinmonks/primexbt-review-88e0815be858) | Leverage Trading, Fee and Covesting
- [Altrady review](https://blog.coincodecap.com/altrady-reivew)
- [Ellipal Titan Review](https://medium.com/coinmonks/ellipal-titan-review-85e9071dd029)
- [SecuX Stone Review](https://blog.coincodecap.com/secux-stone-hardware-wallet-review)
- [BlockFi Review](https://medium.com/coinmonks/blockfi-review-53096053c097) | Earn up to 8.6% interests on your Crypto
- [Coinrule review](https://blog.coincodecap.com/coinrule-review-a-perfect-trading-bot)
- [Best Blockchain Analysis Tools](https://bitquery.io/blog/best-blockchain-analysis-tools-and-software)
- [Crypto arbitrage](https://medium.com/coinmonks/crypto-arbitrage-guide-how-to-make-money-as-a-beginner-62bfe5c868f6) guide: How to make money as a beginner
- Best [Crypto Charting Tool](https://medium.com/coinmonks/what-are-the-best-charting-platforms-for-cryptocurrency-trading-85aade584d80)
- What are the [best books to learn about Bitcoin](https://medium.com/coinmonks/what-are-the-best-books-to-learn-bitcoin-409aeb9aff4b)?

> [Get Best Software Deals Directly In Your Inbox](https://medium.com/coinmonks/newsletters/coinmonks)

[![](https://cdn-images-1.medium.com/max/584/1*BoDnKUyK8p4hitHAJZ5Pdw.png)](https://medium.com/coinmonks/newsletters/coinmonks)

* * *