当前位置: 首页>>代码示例>>Python>>正文


Python Web3.toChecksumAddress方法代码示例

本文整理汇总了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,
开发者ID:oberstet,项目名称:scratchbox,代码行数:33,代码来源:web3_with_twisted.py

示例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
                  )
开发者ID:vovyl,项目名称:gitcoin-erc721,代码行数:33,代码来源:test_kudos.py


注:本文中的web3.Web3.toChecksumAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。