Skip to content

Instantly share code, notes, and snippets.

@coburncoburn
Created January 11, 2019 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coburncoburn/13c8595641668671b9c886ed8e295dd0 to your computer and use it in GitHub Desktop.
Save coburncoburn/13c8595641668671b9c886ed8e295dd0 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.2+commit.1df8f40c.js&optimize=false&gist=
contract SupplyPolicyHook {
struct SupplyLocalVars {
uint startingBalance;
uint newSupplyIndex;
uint userSupplyCurrent;
uint userSupplyUpdated;
uint newTotalSupply;
uint currentCash;
uint updatedCash;
uint newSupplyRateMantissa;
uint newBorrowIndex;
uint newBorrowRateMantissa;
}
function verify() public {}
function verifyWithBytes(bytes memory data) public {
}
function verifyWithInputs(address sender, address asset, uint amount) public {}
function verifyWithLocalResults(
address sender,
address asset,
uint amount,
uint startingBalance,
uint newSupplyIndex,
uint userSupplyCurrent,
uint userSupplyUpdated,
uint newTotalSupply,
uint currentCash,
uint updatedCash,
uint newSupplyRateMantissa,
uint newBorrowIndex,
uint newBorrowRateMantissa) public {}
}
contract SimpleTest {
SupplyPolicyHook public hook;
constructor() public {
hook = new SupplyPolicyHook();
}
function verify() public {
hook.verify();
}
function verifyWithInputs() public {
hook.verifyWithInputs(msg.sender, address(0xABCDE), 1);
}
function verifyWithLocalResults() public {
hook.verifyWithLocalResults(msg.sender, address(0xABCDE), 1,2,3,4,5,5,6,7,8,9,0);
}
function verifyWithBytes() public {
hook.verifyWithBytes(msg.data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment