Solidity contract

PHOTO EMBED

Wed Mar 02 2022 09:47:41 GMT+0000 (Coordinated Universal Time)

Saved by @Taylor #react.js #solidity #contract

pragma solidity ^0.5.11;

contract A {
    address addressB;
    function setAddressB(address _addressB) external {
        addressB = _addressB;
    }
    function callHelloWorld() external view returns(string memory) {
        B b = B(addressB);
        return b.helloWorld();
    }
}

contract B {
    function helloWorld() external pure returns(string memory) {
        return 'HelloWorld';
    }
}



contract MyContract {
    uint a;
    function foo() external {
        if(a == 10) {
            revert('error');
        }
        require(a != 10, 'err');
        assert(a != 10);
    }
    function willThrow() external {
        require(true == false, 'the reasons');
    }
}
content_copyCOPY