I'm trying to encode a function call on a ERC721 smart contract.
I'm using web3-python package to use some utils.
Here is my code:
from web3 import Web3
r = Web3.soliditySha3(['bytes32'], [b'tokenURI(uint256)'])
0xc87b56dda752230262935940d907f047a9f86bb5ee6aa33511fc86db33fea6cc
r[0:10]
0xc87b56dd
This code works partially: I get the signature of the function (0xc87b56dd). However, I want to pass an argument and encode it with the function name together.
So if I want to pass 275
as a parameter, I should get this result instead (at the end of the hash, 113
is 275
hex value):
0xc87b56dd0000000000000000000000000000000000000000000000000000000000000113
I don't know how to achieve that. I read a lot of forums but can't find the right way to do it.
Basically I want to achieve what this website is doing.
contract
object.