Skip to content

Instantly share code, notes, and snippets.

@bitcoinwarrior1
Last active May 3, 2022 08:11
Show Gist options
  • Save bitcoinwarrior1/d186f0e1fb3ae719efe5e216fae8fb6b to your computer and use it in GitHub Desktop.
Save bitcoinwarrior1/d186f0e1fb3ae719efe5e216fae8fb6b to your computer and use it in GitHub Desktop.
A simple contract that acts as a go between for transactions to change the msg.sender for testing (in solidity based tests)
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
// A simple contract that acts as a go between for transactions to change the msg.sender for testing (in solidity based tests)
contract ChangeSender {
function call(address to, bytes4 functionSignature, bytes memory data) public returns(bool success, bytes memory result) {
(success, result) = to.call(abi.encode(functionSignature, data));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment