本文整理匯總了Python中web3.Web3.toChecksumAddress方法的典型用法代碼示例。如果您正苦於以下問題:Python Web3.toChecksumAddress方法的具體用法?Python Web3.toChecksumAddress怎麽用?Python Web3.toChecksumAddress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類web3.Web3
的用法示例。
在下文中一共展示了Web3.toChecksumAddress方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setGreeting
# 需要導入模塊: from web3 import Web3 [as 別名]
# 或者: from web3.Web3 import toChecksumAddress [as 別名]
greeting = 'Hello';
}
function setGreeting(string _greeting) public {
greeting = _greeting;
}
function greet() constant returns (string) {
return greeting;
}
}
"""
# above is deployed here:
contract_address = '0x31bd34ef7dbd96a20098b7a5aaf67a45bbef2726'
contract_address = Web3.toChecksumAddress(contract_address)
# here is the ABI of the contract:
abi = """
[
{
"constant": false,
"inputs": [
{
"name": "_greeting",
"type": "string"
}
],
"name": "setGreeting",
"outputs": [],
"payable": false,
示例2: open
# 需要導入模塊: from web3 import Web3 [as 別名]
# 或者: from web3.Web3 import toChecksumAddress [as 別名]
import json
from web3.auto import w3
from web3 import Web3
with open('build/contracts/Kudos.json') as f:
abi = json.load(f)['abi']
checksummed = Web3.toChecksumAddress('0xe7bed272ee374e8116049d0a49737bdda86325b6')
kudos = w3.eth.contract(address=checksummed, abi=abi)
bugsquasher = dict(name='bugsquasher',
description='exterminator',
rareness=1234,
price=50000,
numClonesAllowed=3
)
collabmachine = dict(name='collaborationmachine',
description='plays nice with others',
rareness=1234,
price=50000,
numClonesAllowed=3
)
designstar = dict(name='designstar',
description='makes nice things',
rareness=1234,
price=50000,
numClonesAllowed=3
)