You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2023. It is now read-only.
I wanted to deposit some ETH to contract address by calling the ABI method named ‘deposit’, maybe the method was not found by the program.
below is the ABI file and my program, Please help me out~
[Error]:
Traceback (most recent call last):
File “/Users/xxx/Project/py3interface/util/connect_kovan.py”, line 126, in
kovan.send_ether_to_contract(0.0001)
File “/Users/renyiguang/Project/py3interface/util/connect_kovan.py”, line 90, in send_ether_to_contract
txn_dict = self.R1.functions.deposit(self.wallet_address, amount_in_ether).buildTransaction({
File “/Users/xxx/.virtualenvs/py3interface-rXFxZXWO/lib/python3.6/site-packages/web3/utils/contracts.py”, line 100, in find_matching_fn_abi
raise ValueError(“No matching functions found”)
ValueError: No matching functions found
[code]:
coding=utf-8
from web3 import Web3, HTTPProvider, contract
import json
import time
from data import contract_abi
indicate ValueError: No matching functions found.
I wanted to deposit some ETH to contract address by calling the ABI method named ‘deposit’, maybe the method was not found by the program.
below is the ABI file and my program, Please help me out~
[Error]:
Traceback (most recent call last):
File “/Users/xxx/Project/py3interface/util/connect_kovan.py”, line 126, in
kovan.send_ether_to_contract(0.0001)
File “/Users/renyiguang/Project/py3interface/util/connect_kovan.py”, line 90, in send_ether_to_contract
txn_dict = self.R1.functions.deposit(self.wallet_address, amount_in_ether).buildTransaction({
File “/Users/xxx/.virtualenvs/py3interface-rXFxZXWO/lib/python3.6/site-packages/web3/utils/contracts.py”, line 100, in find_matching_fn_abi
raise ValueError(“No matching functions found”)
ValueError: No matching functions found
[code]:
coding=utf-8
from web3 import Web3, HTTPProvider, contract
import json
import time
from data import contract_abi
class OperationKovan:
def init(self):
if name == 'main':
kovan = OperationKovan()
blockNum = kovan.get_block_num()
print(blockNum)
# recharge
kovan.send_ether_to_contract(0.0001)
[abi python file]:
abi = """[
{
"constant": true,
"inputs": [],
"name": "withdrawEnabled",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "address"
}
],
"name": "withdrawAllowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "depositToken",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "withdrawn",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addresses",
"type": "address[11][]"
},
{
"name": "values",
"type": "uint256[10][]"
},
{
"name": "v",
"type": "uint8[2][]"
},
{
"name": "r",
"type": "bytes32[2][]"
},
{
"name": "s",
"type": "bytes32[2][]"
}
],
"name": "batchTrade",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "admins",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "admin",
"type": "address"
},
{
"name": "isAdmin",
"type": "bool"
}
],
"name": "setAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "bytes32"
}
],
"name": "buyOrderFilled",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addresses",
"type": "address[11]"
},
{
"name": "values",
"type": "uint256[10]"
},
{
"name": "v",
"type": "uint8[2]"
},
{
"name": "r",
"type": "bytes32[2]"
},
{
"name": "s",
"type": "bytes32[2]"
}
],
"name": "trade",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "address"
}
],
"name": "latestApply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "withdrawNoLimit",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addresses",
"type": "address[3]"
},
{
"name": "values",
"type": "uint256[3]"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "adminWithdraw",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "acceptOwnership",
"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": "enabled",
"type": "bool"
}
],
"name": "enableWithdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "lock",
"type": "uint256"
}
],
"name": "changeLockTime",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "feeRate",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "acc",
"type": "address"
},
{
"name": "asFee",
"type": "bool"
}
],
"name": "setFeeAccount",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "applyWithdraw",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_newOwner",
"type": "address"
}
],
"name": "changeOwner",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "tokenBuy",
"type": "address"
},
{
"name": "amountBuy",
"type": "uint256"
},
{
"name": "tokenSell",
"type": "address"
},
{
"name": "amountSell",
"type": "uint256"
},
{
"name": "base",
"type": "address"
},
{
"name": "expires",
"type": "uint256"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "feeToken",
"type": "address"
}
],
"name": "getOrderHash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "fr",
"type": "uint256"
}
],
"name": "changeFeeRate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "user",
"type": "address"
},
{
"name": "tokens",
"type": "address[]"
}
],
"name": "refund",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "user",
"type": "address"
}
],
"name": "approveWithdraw",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "deposit",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "address"
}
],
"name": "applyList",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "address"
}
],
"name": "tokenList",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "feeAccounts",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "bytes32"
}
],
"name": "sellOrderFilled",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "hash",
"type": "bytes32"
},
{
"name": "v",
"type": "uint8"
},
{
"name": "r",
"type": "bytes32"
},
{
"name": "s",
"type": "bytes32"
}
],
"name": "verify",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "applyWait",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "user",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "VERSION",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"payable": false,
"stateMutability": "nonpayable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "user",
"type": "address"
},
{
"indexed": false,
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"name": "balance",
"type": "uint256"
}
],
"name": "Deposit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "user",
"type": "address"
},
{
"indexed": false,
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"name": "balance",
"type": "uint256"
}
],
"name": "Withdraw",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "token",
"type": "address"
},
{
"indexed": false,
"name": "user",
"type": "address"
},
{
"indexed": false,
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"name": "time",
"type": "uint256"
}
],
"name": "ApplyWithdraw",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "_prevOwner",
"type": "address"
},
{
"indexed": false,
"name": "_newOwner",
"type": "address"
}
],
"name": "OwnerUpdate",
"type": "event"
}
]"""
The text was updated successfully, but these errors were encountered: