Skip to content

Instantly share code, notes, and snippets.

@kangsangsoo
Created February 13, 2023 12:44
Show Gist options
  • Save kangsangsoo/0b66508f84a975f066c34cd594e40147 to your computer and use it in GitHub Desktop.
Save kangsangsoo/0b66508f84a975f066c34cd594e40147 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.18;
contract A{
address public caller;
address public e;
address public d;
address public c;
address public b;
constructor(address _e, address _d, address _c, address _b) {
e = _e;
d = _d;
c = _c;
b = _b;
}
function go() public {
b.delegatecall(abi.encodeWithSignature("go()"));
}
}
contract B{
address public caller;
address public e;
address public d;
address public c;
address public b;
constructor(address _e, address _d, address _c, address _b) {
e = _e;
d = _d;
c = _c;
b = _b;
}
function go() public {
c.delegatecall(abi.encodeWithSignature("go()"));
}
}
contract C{
address public caller;
address public e;
address public d;
address public c;
address public b;
constructor(address _e, address _d, address _c, address _b) {
e = _e;
d = _d;
c = _c;
b = _b;
}
function go() public {
// caller = msg.sender;
d.call(abi.encodeWithSignature("go()"));
}
}
contract D{
address public caller;
address public e;
address public d;
address public c;
address public b;
constructor(address _e, address _d, address _c, address _b) {
e = _e;
d = _d;
c = _c;
b = _b;
}
function go() public {
e.call(abi.encodeWithSignature("go()"));
}
}
contract E{
address public caller;
address public e;
address public d;
address public c;
address public b;
constructor(address _e, address _d, address _c, address _b) {
e = _e;
d = _d;
c = _c;
b = _b;
}
function go() public {
caller = msg.sender;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment