Last active
March 21, 2023 08:18
-
-
Save CJ42/f435b09cff9f5c0949c963a147bd3e84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: GPL-3.0 | |
pragma solidity ^0.8.0; | |
contract DeployedContract { | |
uint public result = 0; | |
function add(uint256 input) public { | |
result = result + input; | |
} | |
} | |
contract Proxy { | |
address deployed_contract = 0x1212121212121212121212121212121212121212; | |
function lowLevelCall(uint256 lucky_number) public { | |
bytes memory _calldata = abi.encode(bytes4(keccak256("add(uint256)")), lucky_number); | |
deployed_contract.call(_calldata); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment