bobcat-proxy 0.7.47

bobcat-sdk utilities for creating proxy code on Arbitrum Stylus.
Documentation
// beacon-proxy: A proxy that simply calls "implementation()" to get the
// address it should delegate to.

#define constant SLOT_BEACON = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50

#define macro IMPL_ADDR() = takes(0) returns(1) {
   0x20 0x5c60da1b dup2 mstore
   dup1 dup1 0x4 0x3c [SLOT_BEACON] sload gas staticcall
   pop mload
}

#define macro MAIN() = takes(0) returns(0) {
    calldatasize 0x0 0x0 calldatacopy
    0x0 0x0 calldatasize 0x0 IMPL_ADDR() gas delegatecall
    0x0 returndatasize 0x0 0x0 returndatacopy
    returndatasize swap2 RETURN jumpi revert
    RETURN: return
}

#define macro CONSTRUCTOR() = takes(0) returns(0) {
    0x90b75E378f50a871E4125ba9D1Ef9a3826CEdF41 [SLOT_BEACON] sstore
}