Created
February 13, 2023 12:44
-
-
Save kangsangsoo/0b66508f84a975f066c34cd594e40147 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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