Created
February 13, 2023 12:38
-
-
Save kangsangsoo/fd73e98dbcb442a18a76f1f3a79b3134 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 d; | |
address public c; | |
address public b; | |
constructor(address _d, address _c, address _b) { | |
d = _d; | |
c = _c; | |
b = _b; | |
} | |
function go() public { | |
b.delegatecall(abi.encodeWithSignature("go()")); | |
} | |
} | |
contract B{ | |
address public caller; | |
address public d; | |
address public c; | |
address public b; | |
constructor(address _d, address _c, address _b) { | |
d = _d; | |
c = _c; | |
b = _b; | |
} | |
function go() public { | |
c.delegatecall(abi.encodeWithSignature("go()")); | |
} | |
} | |
contract C{ | |
address public caller; | |
address public d; | |
address public c; | |
address public b; | |
constructor(address _d, address _c, address _b) { | |
d = _d; | |
c = _c; | |
b = _b; | |
} | |
function go() public { | |
// caller = msg.sender; | |
d.call(abi.encodeWithSignature("go()")); | |
} | |
} | |
contract D{ | |
address public caller; | |
address public d; | |
address public c; | |
address public b; | |
constructor(address _d, address _c, address _b) { | |
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