Skip to content

Instantly share code, notes, and snippets.

@CJ42
Last active March 21, 2023 08:18
Show Gist options
  • Save CJ42/f435b09cff9f5c0949c963a147bd3e84 to your computer and use it in GitHub Desktop.
Save CJ42/f435b09cff9f5c0949c963a147bd3e84 to your computer and use it in GitHub Desktop.
// 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