답변주셔서 감사합니다.
컨트렉트 코드는 다음과 같습니다.
pragma solidity ^0.4.25;
contract Withdraw {
address public owner;
constructor(address _owner) public {
owner = _owner;
}
function deposit() public payable {
}
function withdraw(uint256 amount) public {
require(msg.sender == owner);
owner.transfer(amount);
}
function getBalance() public view returns (uint256) {
return address(this).balance;
}
}
그리고 abi는 3가지 형식으로 테스트 했는데, 아직까지 같은 에러가 발생중입니다.
=> Format 1: Json
[
{
‘constant’: true,
‘inputs’: [],
‘name’: ‘getBalance’,
‘outputs’: [
{
‘name’: ‘’,
‘type’: ‘uint256’
}
],
‘payable’: false,
‘stateMutability’: ‘view’,
‘type’: ‘function’
},
{
‘constant’: false,
‘inputs’: [
{
‘name’: ‘amount’,
‘type’: ‘uint256’
}
],
‘name’: ‘withdraw’,
‘outputs’: [],
‘payable’: false,
‘stateMutability’: ‘nonpayable’,
‘type’: ‘function’
},
{
‘constant’: true,
‘inputs’: [],
‘name’: ‘owner’,
‘outputs’: [
{
‘name’: ‘’,
‘type’: ‘address’
}
],
‘payable’: false,
‘stateMutability’: ‘view’,
‘type’: ‘function’
},
{
‘constant’: false,
‘inputs’: [],
‘name’: ‘deposit’,
‘outputs’: [],
‘payable’: true,
‘stateMutability’: ‘payable’,
‘type’: ‘function’
},
{
‘inputs’: [
{
‘name’: ‘_owner’,
‘type’: ‘address’
}
],
‘payable’: false,
‘stateMutability’: ‘nonpayable’,
‘type’: ‘constructor’
}
]
=> Format 2: Json string of format 1
=> Format 3:
‘[{‘constant’:true,‘inputs’:[],‘name’:‘getBalance’,‘outputs’:[{‘name’:’’,‘type’:‘uint256’}],‘payable’:false,‘stateMutability’:‘view’,‘type’:‘function’},{‘constant’:false,‘inputs’:[{‘name’:‘amount’,‘type’:‘uint256’}],‘name’:‘withdraw’,‘outputs’:[],‘payable’:false,‘stateMutability’:‘nonpayable’,‘type’:‘function’},{‘constant’:true,‘inputs’:[],‘name’:‘owner’,‘outputs’:[{‘name’:’’,‘type’:‘address’}],‘payable’:false,‘stateMutability’:‘view’,‘type’:‘function’},{‘constant’:false,‘inputs’:[],‘name’:‘deposit’,‘outputs’:[],‘payable’:true,‘stateMutability’:‘payable’,‘type’:‘function’},{‘inputs’:[{‘name’:’_owner’,‘type’:‘address’}],‘payable’:false,‘stateMutability’:‘nonpayable’,‘type’:‘constructor’}]’
빠른 답변 감사드립니다.