Skip to content

A quick way to decode a contract's transaction data with only the contract address and abi.

License

Notifications You must be signed in to change notification settings

degatchi/tx-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tx-decoder

A quick way to decode a contract's transaction data with only the contract address and abi.

E.g,

let tx_data = "0xe70dd2fc000000000000000000000000000000000000000000000000000000000000014000000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000005ac103444df194d6e77b0393e000000000000000000000000000000000000000b5c0e8d21d902d61fa0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082828f6aff831e0d8b366d7b33caf12b3923277200000000000000000000000000000000000041b6e3927bcdbbf5fa7c74000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000ff970a61a04b1ca14834a43f5de4533ebddb5cc8";

for the current abi in src/abi.json returns:

CreateDecreasePosition(
    CreateDecreasePositionCall { 
        path: [0xff970a61a04b1ca14834a43f5de4533ebddb5cc8], 
        index_token: 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 
        collateral_delta: 449391823907218545570703489342, 
        size_delta: 900000000000000000000000000000, 
        is_long: false, 
        receiver: 0x82828f6aff831e0d8b366d7b33caf12b39232772, 
        acceptable_price: 1332846580000000000000000000000000, 
        min_out: 0, 
        execution_fee: 100000000000000, 
        withdraw_eth: false 
    }
)

Quick start

Replace:

  • Abi: src/abi.json" with your contract abi file.
  • Tx Data: tx_data string.
  • Run: cargo run.

About

A quick way to decode a contract's transaction data with only the contract address and abi.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages