Skip to content

Instantly share code, notes, and snippets.

@lyhistory
Created December 20, 2018 09:40
Show Gist options
  • Save lyhistory/d168c5c69d5a3da8838596bd713e5895 to your computer and use it in GitHub Desktop.
Save lyhistory/d168c5c69d5a3da8838596bd713e5895 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.4.17+commit.bdeb9e52.js&optimize=false&gist=
pragma solidity ^0.4.17;
library SomeLib {
event calledSomeLib(address _from);
function calledSomeLibFun() public{
calledSomeLib(address(this));
}
}
contract SomeContract{
event callMeMaybeEvent(address _from);
function callMeMaybe() payable public {
callMeMaybeEvent(address(this));
}
}
contract ThatCallsSomeContract{
function callTheOtherContract(address _contractAddress) public{
require(_contractAddress.call(bytes4(keccak256("callMeMaybe()"))));
require(_contractAddress.delegatecall(bytes4(keccak256("callMeMaybe()"))));
SomeLib.calledSomeLibFun();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment