solidity/test/libsolidity/ABIJson/view_function.sol

60 lines
1.2 KiB
Solidity
Raw Normal View History

2019-07-02 15:30:54 +00:00
contract test {
function foo(uint a, uint b) public returns (uint d) { return a + b; }
function boo(uint32 a) public view returns(uint b) { return a * 4; }
}
// ----
// :test
// [
// {
2019-09-03 15:55:00 +00:00
// "constant": true,
2019-07-02 15:30:54 +00:00
// "inputs":
// [
// {
2019-09-03 15:55:00 +00:00
// "internalType": "uint32",
2019-07-02 15:30:54 +00:00
// "name": "a",
2019-09-03 15:55:00 +00:00
// "type": "uint32"
2019-07-02 15:30:54 +00:00
// }
// ],
2019-09-03 15:55:00 +00:00
// "name": "boo",
2019-07-02 15:30:54 +00:00
// "outputs":
// [
// {
2019-07-02 14:04:52 +00:00
// "internalType": "uint256",
2019-09-03 15:55:00 +00:00
// "name": "b",
2019-07-02 15:30:54 +00:00
// "type": "uint256"
// }
// ],
// "payable": false,
2019-09-03 15:55:00 +00:00
// "stateMutability": "view",
2019-07-02 15:30:54 +00:00
// "type": "function"
// },
// {
2019-09-03 15:55:00 +00:00
// "constant": false,
2019-07-02 15:30:54 +00:00
// "inputs":
// [
// {
2019-09-03 15:55:00 +00:00
// "internalType": "uint256",
2019-07-02 15:30:54 +00:00
// "name": "a",
2019-09-03 15:55:00 +00:00
// "type": "uint256"
// },
// {
// "internalType": "uint256",
// "name": "b",
// "type": "uint256"
2019-07-02 15:30:54 +00:00
// }
// ],
2019-09-03 15:55:00 +00:00
// "name": "foo",
2019-07-02 15:30:54 +00:00
// "outputs":
// [
// {
2019-07-02 14:04:52 +00:00
// "internalType": "uint256",
2019-09-03 15:55:00 +00:00
// "name": "d",
2019-07-02 15:30:54 +00:00
// "type": "uint256"
// }
// ],
// "payable": false,
2019-09-03 15:55:00 +00:00
// "stateMutability": "nonpayable",
2019-07-02 15:30:54 +00:00
// "type": "function"
// }
// ]