etherlime-3-Etherlime Library API-Deployed Contract Wrapper
Deployed Contract Wrapper部署合约的封装
Wrappers封装
One of the advancements of the etherlime is the result of the deployment - the DeployedContractWrapper
etherlime的进步之一就是部署的结果-DeployedContractWrapper
The DeployedContractWrapper is a powerful object that provides you with ethers.Contract amongst other functionalities. This allows you to start using your deployed contract right away as part of your deployment sequence (f.e. you can call initialization methods)
DeployedContractWrapper是一个能够在其他功能中提供给你 ethers.Contract的强势的对象。这将允许你马上开始使用部署的合约作为部署序列的一部分
In addition it exposes you verboseWaitForTransaction(transaction, transactionLabel) function. This function can be used to wait for transaction to be mined while giving you verbose output of the state. In addition it allows you to specify a label for the transaction you are waiting for, so that you can get a better understanding of what transaction is being waited for. This comes in handy when deployment scripts start to grow.
除了暴露给你verboseWaitForTransaction(transaction, transactionLabel)函数。当给你状态的详细输出时,这个函数可以用来等待交易被挖矿。除此之外还允许你给你等待的交易指定标签,这样你就可以对正在等待的交易有更好的理解。当部署脚本开始增长时,这非常有用。
const contractWrapper = await deployer.deploy(ICOTokenContract);
const transferTransaction = await contractWrapper.contract.transferOwnership(randomAddress);
const result = await contractWrapper.verboseWaitForTransaction(transferTransaction, 'Transfer Ownership');
verboseWaitForTransaction函数的作用就是等待交易成功被记录在区块上,然后返回交易的receipt
Working with previously deployed contracts使用以前部署的和合约
Sometimes you want to work with already deployed contract. The deployer object allows you to wrap such an deployed contract by it’s address and continue using the power of the wrapper object. The function you can use to achieve this is wrapDeployedContract(contract, contractAddress).
有时你想要使用已经部署的合约。部署对象将允许你通过它的地址来封装这个部署合约,然后就可以继续使用这个封装对象的功能。你可以使用wrapDeployedContract(contract, contractAddress)这个函数来得到封装对象
const deployedContractWrapper = deployer.wrapDeployedContract(SomeContractWithInitMethod, alreadyDeployedContractAddress); const initTransaction = await deployedContractWrapper.contract.init(randomParam, defaultConfigs);
const result = await deployedContractWrapper.verboseWaitForTransaction(initTransaction, 'Init Contract');
etherlime-3-Etherlime Library API-Deployed Contract Wrapper的更多相关文章
- Google Ajax Library API使用方法(JQuery)
Google Ajax Library API使用方法 1.传统方式: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7. ...
- etherlime-2-Etherlime Library API-deployer
Etherlime Library API 库API Deployer部署者 Deployer functionality The main functionality the deployer ex ...
- 试写foxit reader的ConvertToPDF功能的wrapper
相比于直接fuzzing大型程序本身,针对程序的某一特定功能写wrapper后再fuzzing则要高效的多.网上搜了下,仅有两篇关于foxit reader的wrapper文章,一个用python,另 ...
- TensorFlow Lite demo——就是为嵌入式设备而存在的,底层调用NDK神经网络API,注意其使用的tf model需要转换下,同时提供java和C++ API,无法使用tflite的见后
Introduction to TensorFlow Lite TensorFlow Lite is TensorFlow’s lightweight solution for mobile and ...
- 使用Java Service Wrapper在Linux下配置Tomcat应用
前言 Java Service Wrapper是Tanuki Software的一个产品,可以将Java应用注册成Windows或Linux服务,使其可以随系统开机启动,同时可以监控Java应用的状态 ...
- Java Service Wrapper配置详解
#encoding=UTF-8 # Configuration files must begin with a line specifying the encoding # of the the fi ...
- Windows api 函数全部列表 (未完成)
网上找了很久,发现没有完整版的,msdn上面有,但是不方便查阅,所以想自己整理一下:由于工程量过于庞大,希望大家共同完成.MSDN:http://msdn.microsoft.com/en-us/li ...
- wrapper x64 版本发布到centos
背景: 项目需要在spark任务提交服务器节点上自动提交任务到spark集群上.因此创建了一个固定时间监控任务项目,使用timer定时监控oracle数据库中是否有spark提交任务,如果有spark ...
- 完全自主创建Wrapper Tomcat容器
Wrapper Tomcat 使用说明1. Wrapper Tomcat 简介1) Wrapper Tomcat 是使用Apache Tomcat 整合 Java Service Wrapper 的一 ...
随机推荐
- CSS starts
I have not written any articles here since I graduated from my university. Now I begin to write down ...
- python数据类型之字典
字典定义 字典是一种 key-value 的数据类型,这点很重要,是区别使用列表和字典的依据. 语法格式: info = { 'stu1101': "Aaron", 'stu110 ...
- php返回数组后处理(开户成功后弹窗提示)
1. 在注册的时候,注册成功后经常会弹窗提示自己注册的信息,这类做法需要返回mysql数据库中获取的数组值,返回给前台页面,赋值给弹窗. 2.做法: 返回数组 打印的数组的值 返回数组处理 赋值给弹窗 ...
- cf121C. Lucky Permutation(康托展开)
题意 题目链接 Sol 由于阶乘的数量增长非常迅速,而\(k\)又非常小,那么显然最后的序列只有最后几位会发生改变. 前面的位置都是\(i = a[i]\).那么前面的可以直接数位dp/爆搜,后面的部 ...
- CSDN博客大事日记1
一. 2016-10-18,申请了博客专家,但是因为PV不够,所以很荣幸的成为了一名CSDN准博客专家,接下,得更加努力了争取早日成为博客专家,在此立帖为证哦. ...
- Redis在windows下安装过程(转载)
转载自(http://www.cnblogs.com/M-LittleBird/p/5902850.html) 一.下载windows版本的Redis 官网以及没有下载地址,只能在github上下载, ...
- Play-with-chrome之环境搭建
前言 浏览器漏洞在 APT 攻击中用的比较多,而且这基本上是用户上网的标配了,所以研究浏览器的漏洞是十分有前景的,我认为.我选择 chrome 浏览器 ( chromium和 chrome之间的关系请 ...
- android 自定义控件之ViewGroup生命周期执行步骤
前言 了解ViewGroup的生命周期的执行步骤对于自己自定义ViewGroup的时候十分重要,清楚了整个流程才能对ViewGroup有更深的理解.本文从个人的总结,来阐述一下执行的顺序.执行说明 首 ...
- gearman入门初步
原文地址:http://blog.sina.com.cn/s/blog_5f54f0be0101btsi.html PHP 没有提供直接的并发功能.要实现并发,必须: function asy ...
- Week6——Lifecycle of JSF and Facelets
一.JSF生命周期 JSF是基于事件驱动.JSF生命周期分为两个主要阶段:执行阶段和渲染阶段. 1.执行阶段 分为六个阶段: 恢复视图阶段 当客户端请求一个JavaServer Faces页面时,Ja ...