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 的一 ...
随机推荐
- Q:判断链表中是否存在环的相关问题
问题:如何判断一个单向链表中是否存在环? 例如: 链表中存在环(B-->D): <-- <--^ | | v | A-->B-->C-->D 链表中不存在环: A- ...
- js小练习
1.题目:某班的成绩出来了,现在老师要把班级的成绩打印出来. 效果如下:xxx年xx月x日 星期x--班级总分为:81 格式要求:1.显示打印的日期.格式为类似“xxxx年xx月xx日 星期x”的当 ...
- 导航栏布局时遇到的问题以及解决办法 css选择器优先级
得到的导航栏效果 添加#menu ul li{width:30px;} 效果如图 将会使列表项和分隔区域的宽度同时改变因为id选择器的优先级高于类选择器,此时应该为列表项添加内联样式如图 才能得到如下 ...
- html--对URL传参数进行解析
跳转页面需要传参数到另外一个html页面,跳转链接可写一个js的function function doView(articleId) { window.location.href ="co ...
- 浏览器根对象window之操作方法
1.1 不常用 alert:带有一条指定消息和一个OK按钮的警告框. confirm:带有指定消息和OK及取消按钮的对话框. prompt:可提示用户进行输入的对话框. print:打印网页. ope ...
- Ubuntu中利用rename批量重命名
1.简介: 通常在机器视觉的学习过程中,需要批量处理一些图片,通常会涉及到批量重命名的问题,可以利用rename命令快速实现图片的批量重命名 2.rename命令格式: rename [-v] [-n ...
- Eclipse创建第一个Servlet(Dynamic Web Project方式)、第一个Web Fragment Project(web容器向jar中寻找class文件)
创建第一个Servlet(Dynamic Web Project方式) 注意:无论是以注解的方式还是xml的方式配置一个servlet,servlet的url-pattern一定要以一个"/ ...
- mysql 日期时间类型
datetime timestamp year date time drop table test;create table test (dt datetime, ts timestamp, y ye ...
- MongoDB数据库安装及配置环境(windows10系统)
windows10系统下MongoDB的安装及环境配置: MongoDB的安装 下载地址: https://www.mongodb.com/download-center (这是windows10环境 ...
- spring boot(17)-@Async异步
验证码的异步机制 上一篇讲过可以用邮件发验证码,通常我们在某网站发验证码时,首先会提示验证码已发送,请检查邮箱或者短信,这就是图中的1和3.然而此时查看邮箱或短信可能并没有收到验证码,往往要过几秒种才 ...