from glider import*defquery(): instructions = (Instructions().with_callee_function_name_prefix("upgrade").exec(1) )return instructions
Output Example
{"contract":string"0x02551ded3f5b25f60ea67f258d907ed051e042b2""contract_name":string"BasePatchFixRouter""sol_function":solidityfunctionatomicPatchAndUpgrade() external {require(msg.sender == OWNER);// First claim ownership via the transfer NOTIONAL.claimOwnership(); NOTIONAL.upgradeToAndCall( SELF, abi.encodeWithSelector(BasePatchFixRouter.patchFix.selector) ); NOTIONAL.upgradeTo(FINAL_ROUTER);// Do a direct transfer back to the owner NOTIONAL.transferOwnership(OWNER,true);// Safety check that we do not lose ownershiprequire(NOTIONAL.owner() == OWNER);selfdestruct(payable(OWNER)); }"sol_instruction":solidity NOTIONAL.upgradeToAndCall( SELF, abi.encodeWithSelector(BasePatchFixRouter.patchFix.selector) )}