I have a smartcontract deployed on Goerli at 0x77a286b658191c9A8504D9e8E5c7B6381caA9e72. It uses @openzeppelin/contracts/access/AccessControl.sol, allowing granting roles to some addresses, and baseUri() is allowed to be read only by USER_ROLE. The creator is 0x19D67dBE3018E2565A7b17Fe7F673770BC95a3FF, and so he has the USER_ROLE thanks to the constructor. The contract is verified, you can check the code it's pretty straightforward.
I'm calling baseUri() with creator's address, but how can I decode this ???
useEffect(() => {
alchemy.core
.call({
from: "0x19D67dBE3018E2565A7b17Fe7F673770BC95a3FF",
to: "0x02fcd793358C8a7Aa4b1e723035e80c65C67eeDe",
data: "0xa4e0f3be", // keccak256(baseUri)
})
.then((res) => {
console.log(res);
setUri(res);
setIsUriSuccess(true);
});
}, []);
returns
0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005168747470733a2f2f697066732e696f2f697066732f62616679626569636e73686f687265686864753370646c366d34797469636f7078746d6c336b74786a36377777766d6f77357a36326b33656c6a652f000000000000000000000000000000
How can I decode this ? I want to retrieve the string "https://www.google.fr", the original value.