polkadot_delegate_call.sol 1.0 KB

12345678910111213141516
  1. // RUN: --target polkadot --emit cfg
  2. contract CallFlags {
  3. function delegate_call(address _address, uint32 _flags) public returns (bytes ret) {
  4. (bool ok, ret) = _address.delegatecall{flags: _flags}(hex"deadbeef");
  5. (ok, ret) = address(this).delegatecall(hex"cafebabe");
  6. // CHECK: block0: # entry
  7. // CHECK: ty:address %_address = (arg #0)
  8. // CHECK: ty:uint32 %_flags = (arg #1)
  9. // CHECK: ty:bytes %ret = (alloc bytes len uint32 0)
  10. // CHECK: %success.temp.4 = external call::delegate address:(arg #0) payload:(alloc bytes uint32 4 hex"deadbeef") value:uint128 0 gas:uint64 0 accounts: seeds: contract|function:_ flags:(arg #1)
  11. // CHECK: ty:bytes %ret = (external call return data)
  12. // CHECK: %success.temp.5 = external call::delegate address:address((load (builtin GetAddress ()))) payload:(alloc bytes uint32 4 hex"cafebabe") value:uint128 0 gas:uint64 0 accounts: seeds: contract|function:_ flags:
  13. // CHECK: ty:bytes %ret = (external call return data)
  14. }
  15. }