Sign in

Proxies - Test

01.

In the off-chain-compute pattern, a user computes a value off-chain and submits it to the contract. The user can submit any value they want, including a wrong one.

02.

A UUPS implementation has a function that calls selfdestruct(payable(msg.sender)) under certain conditions. An attacker manages to trigger this on the implementation contract directly (calling it at its own address, not through the proxy). The implementation contract is destroyed. What happens to the proxy?

03.

A team deploys their UUPS proxy in two separate transactions. First, they call the factory to deploy the proxy + implementation. The deployment script then calls initialize() on the proxy as a follow-up transaction:

typescript
const proxy = await factory.deployProxy(implementation);
await proxy.initialize(deployerAddress);  // sets owner

A bot watching the mempool sees the proxy contract deployed. Before the team's initialize() transaction confirms, the bot front-runs it by calling initialize(botAddress) itself. What is the outcome?

04.

A function declared as function f(uint256[] memory arr) external differs from function f(uint256[] calldata arr) external in what way?

05.

When upgrading a UUPS proxy, who initiates the upgrade?