Skip to content

Instantly share code, notes, and snippets.

@kangsangsoo
Created February 13, 2023 12:38
Show Gist options
  • Save kangsangsoo/fd73e98dbcb442a18a76f1f3a79b3134 to your computer and use it in GitHub Desktop.
Save kangsangsoo/fd73e98dbcb442a18a76f1f3a79b3134 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 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