1/5
## Manually Creating The Hexdata We've learned how to use remix to send raw hexadecimal data to our contracts. This hexdata that is sent is also known as the *calldata*. Now we can go a step further. Let's check this out. We'll go back in our terminal. We can use the *cast* tool to manually create the hex, doing the same thing that we did in *vipper*. We can do ```bash % cast calldata --help ``` We can see it takes the function signature and the arguments, and it will encode them to create that hex object. Let's clear. We'll do ```bash % cast calldata "transfer(address,uint256)" ``` Let's use the address for account four in Metamask: ```bash % cast calldata "transfer(address,uint256)" "0xBC989fDe54Ca4d2aB4392Af6dF60f6d04873A033A" ``` And for an amount we'll do 31337. Enter. So, this is the raw hex here, and now if we copy this, the amount right now is 100 and some address is this one. We can paste this raw data into the low level interactions, and hit transact. Now we can scroll up and see the amount is now 31337 and some address has also been changed. This is how we can use low level power to call anything. We now know how this hex data in transactions is being generated. We can make sure we know what's going on here, what the first section is, et cetera.
A practical guide to manually creating calldata - Learn how to use the 'cast calldata' tool in the terminal to create hexadecimal data for sending to a smart contract. This lesson uses Remix IDE to demonstrate sending calldata to an external function and analyzing the results.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
How to build a DeFi stablecoin and customized NFT
How to deploy your smart contract on ZKsync with Moccasin
Advanced testing techniques like stateful and stateless Python fuzzing
How to write algorithmic trading scripts in Python
Hashing signatures, proxies, delegate calls, upgradable contracts, random numbers, and more!
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on February 4, 2025
Duration: 2h 21min
Duration: 1h 58min
Duration: 2h 55min
Duration: 1h 55min
Duration: 46min
Course Overview
About the course
How to build a DeFi stablecoin and customized NFT
How to deploy your smart contract on ZKsync with Moccasin
Advanced testing techniques like stateful and stateless Python fuzzing
How to write algorithmic trading scripts in Python
Hashing signatures, proxies, delegate calls, upgradable contracts, random numbers, and more!
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on February 4, 2025