Guest User

Untitled

a guest
Jul 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. contract A {
  2. function test1() public view returns(bool) {
  3. return false;
  4. }
  5. }
  6. contract B {
  7. function testCall(address addr, data) public view returns(bool) {
  8. return addr.call.value(0)(data);
  9. }
  10. }
  11.  
  12. const a = await A.new()
  13. const b = await B.new()
  14.  
  15. const aWeb3 = web3.eth.contract(a.abi)
  16. const aInstance = aWeb3.at(a.address)
  17.  
  18. const testData = aInstance.test1.getData()
  19.  
  20. const ans = await bInstance.testCall(aInstance.address, testData)
  21.  
  22. console.log(ans)
  23.  
  24. assembly{
  25. let success := call(10000, addr, 0, add(data, 0x20), mload(data), 0, 0x20)
  26. res := mload(0)
  27. }
  28. return res
Add Comment
Please, Sign In to add comment