If you have an evm address, then our connectors generates a predicate corresponding to that evm address. this way, you can have a predicate for an evm address and this predicate will use the signature of the evm wallet to make txns.
Fuel uses a 32-byte address format, and this is why a Fuel hex address is longer (66 characters) compared to an ETH address (42 characters).
Fuel addresses can be converted between different formats using the Fuel SDK. For example, you can convert between Bech32 and hex formats. Here’s how you can convert a Bech32 address to a hex format:
In Fuel, the Identity type can be either an Identity::Address or an Identity::ContractId. When dealing with wallet addresses, they are typically represented as Identity::Address.
But lets say I have a bunch of EVM addresses, I need to know how to send them funds on fuel. With only their EVM address is there a function to generate their Fuel address which uses the predicate?
Hey @diyahir We don’t have this logic in the SDK and you’d have to use the connectors package for it.
You can find here how we’re getting the predicate addresses associated with some EVM addresses. This seems like the thing you need. In the end, it boils down to a call to this method. Lmk if you are looking for something else
I wrote this script to perform the action here:
Can you validate it? I want to make sure I get it right, currently to validate I have been connecting to a wallet on a fuel dapp using it and just spot checking that it spits out the right address
You can run it by using the following command
npm run generate-predicate-addresses
and it outputs to generated/predicate-addresses.json