God Mode
Privately invoke arbitrary smart contracts.
Last updated
Privately invoke arbitrary smart contracts.
Last updated
God Mode is an advanced user mode in Firn, which lets you withdraw to contracts. Specifically, Firn supports a variant sort of withdrawal whereby, instead of withdrawing your funds directly to an EOA, Firn sends them to a payable function on some contract, and simultaneously supplies user-specified calldata to that function.
The effect of this is that you can call any function on any contract "as" Firn; the identity of the caller is hidden. For example, you could buy some token, say, anonymously, and direct the token to some fresh account with no history. This feature is very powerful. While you could emulate a similar functionality by, say, withdrawing first to a burner EOA, and then using that EOA to transact, with God Mode, you can do the same thing gasslessly (you don't have to worry about leaving leftover gas in the burner account), and in just one step. This even works for non-payable functions; in the same way, you can even call these gasslessly and anonymously.
In this post, we will walk you through how to do this, via an example. In this example, we will buy 1 ETH worth of FIRN Token, anonymously.
First, log into Firn, and navigate to the "Withdrawal" tab; then, click the "God Mode" toggle. Enter the address of the contract containing the function you want to call. For example, we will enter the address 0xE592427A0AEce92De3Edee1F18E0157C05861564
of the UniswapV3Router
. At this point, since the contract is verified on Etherscan, the contract ABI will auto-populate; for unverified contracts, you will have to enter the ABI manually.
At this point, you can either manually select a function and enter its arguments, or else enter raw hexadecimal calldata (see the "Raw Hex" toggle). In our case, we will manually enter the arguments required for our purchase; we direct the resulting token to a fresh address.
In practice, it is fairly unusual that you will want to enter these yourself, unless you're very sure of what you're doing (or you're interacting with a simple contract). Indeed, usually, when we interact with the blockchain, front-end web applications populate our transactions for us.
Alternatively, you can also simply enter the raw hexadecimal calldata you want (including the 4-byte function signature and the ABI-encoded arguements). In practice, you might "lift" this from a transaction prompt populated by some other application.
To do this, toggle the "Raw Hex" switch. You'll see something like this:
Click "Transact Privately", and your transaction will be dispatched.