Guest User

Untitled

a guest
Oct 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. pragma solidity ^0.4.24;
  2. import "./Second.sol";
  3.  
  4. contract First {
  5. Second private _oSecond;
  6. int32 public _nRes1;
  7.  
  8. constructor(address oSecond) public payable {
  9. _oSecond = Second(oSecond);
  10. _nRes1 = 3;
  11. }
  12. function TestError() public {
  13. _oSecond.State();
  14. //_oSecond._nRes2(); // the problem call is here
  15. _nRes1 = 5;
  16. }
  17. }
  18.  
  19. pragma solidity ^0.4.24;
  20.  
  21. contract Second {
  22. int32 public _nRes2;
  23.  
  24. constructor() public {
  25. _nRes2 = 15;
  26. }
  27. function State() public {
  28. _nRes2 = 17;
  29. }
  30. }
  31.  
  32. (async () => {
  33. await first.methods.TestError().send({from: accounts[0]});
  34. var nRes = await first.methods._nRes1().call({from: accounts[0]});
  35. console.log(nRes);
  36.  
  37. var nRes = await second.methods._nRes2().call({from: accounts[0]});
  38. console.log(nRes);
  39. })();
Add Comment
Please, Sign In to add comment