Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Last active May 5, 2025 01:15
Show Gist options
  • Save Turupawn/509e9315f3f9167c410ca98eba93e4d4 to your computer and use it in GitHub Desktop.
Save Turupawn/509e9315f3f9167c410ca98eba93e4d4 to your computer and use it in GitHub Desktop.
6027600D60003960276000F3FE7F00000000000000000000000000000000000000000000000000000000000000105F5260205FF3
// Header
6038600D60003960386000F3FE
// Code
5F357F0DBE671F0000000000000000000000000000000000000000000000000000000014602F5760055F5260205FF35B60045F5260205FF3
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IRawContract {
function a() external pure returns (uint256);
function b() external pure returns (uint256);
}
63 23B872DD // Push signature
7C 0100000000000000000000000000000000000000000000000000000000
02 // Mul to shift right
5F // Start in memory 0
52
7f 000000000000000000000000707e55a12557E89915D121932F83dEeEf09E5d70 // From
60 04
52 // Store param1
7f 000000000000000000000000bef34f2FCAe62dC3404c3d01AF65a7784c9c4A19 // To
60 24
52 // Store param2
7f 0000000000000000000000000000000000000000000000487A9A304539440000 // Amount
60 44
52 // Store param3
60 20 // Return size 32 bytes
61 1000 // Return offset, put in whatever
61 0256 // Args size (signature + from + to + amount) push(100 bytes)
5F // Args offset push(0)
5F // Value push(0)
73 E7ceD894c7F7c2923Eb0186D9d97F909289a09f5 // Smart contract push(address)
62 135168 // Gas push(21000)
F1
gas: amount of gas to send to the sub context to execute. The gas that is not used by the sub context is returned to this one.
address: the account which context to execute.
value: value in wei to send to the account.
argsOffset: byte offset in the memory in bytes, the calldata of the sub context.
argsSize: byte size to copy (size of the calldata).
retOffset: byte offset in the memory in bytes, where to store the return data of the sub context.
retSize: byte size to copy (size of the return data).
61016C600F60003961016C6000F3FE
6323B872DD7C0100000000000000000000000000000000000000000000000000000000025F527f000000000000000000000000707e55a12557E89915D121932F83dEeEf09E5d706004527f000000000000000000000000bef34f2FCAe62dC3404c3d01AF65a7784c9c4A196024527f0000000000000000000000000000000000000000000000487A9A30453944000060445260206110006102565F5F73E7ceD894c7F7c2923Eb0186D9d97F909289a09f562135168F1
* FE no es necesario (investigar?)
* En el contrato 1 usar push1 en vez de push32 para ahorrar gas en el deploy
* En el contrato 3 en vez de 0256 usar 0064, y también usar entonces push1 en vez de push2
@cooldev1337
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment