Created
December 20, 2018 09:40
-
-
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=
This file contains 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
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