bobcat-proxy 0.7.45

bobcat-sdk utilities for creating proxy code on Arbitrum Stylus.
Documentation
// metamorphic-on-fn-beacon.huff: A proxy that asks the BEACON address
// for the location of where to delegatecall to if the migrate function
// is called. It sends an empty message for this. Doesn't handle properly if
// if the beacon reverts.

#define constant SLOT_IMPL = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc

#define function migrate() nonpayable returns ()

#define constant ADDR_BEACON = 0x1000000000000000000000000000000000000001

#define macro MAIN() = takes(0) returns(0) {
	0x0 calldataload 0xe0 shr __FUNC_SIG(migrate) eq MIGRATE jumpi
	ALL jump
	MIGRATE:
		0x20 0x0 0x0 0x0 [ADDR_BEACON] gas staticcall 0x0 mload
		CONT jump
	ALL:
		[SLOT_IMPL] sload
	CONT:
		calldatasize 0x0 0x0 calldatacopy
		0x0 calldatasize 0x0 0x0 swap4 gas delegatecall
		returndatasize 0x0 0x0 returndatacopy
		returndatasize 0x0 dup3 RETURN jumpi revert
	RETURN:
		return
}