Ownable Contracts
function setKittyContractAddress(address _address) external {
kittyContract = KittyInterface(_address);
}
external 任何人都可以访问该函数修改该kittyContract 的地址,如何做到只有一个人访问该函数修改kittyContract 的值?
OpenZeppelin库的Ownable 合约
1.import “./ownable.sol”;
2.该合约contract ZombieFactory is Ownable
继承了Ownable合约
// 修改这个函数:
function setKittyContractAddress(address _address) external onlyOwner {
kittyContract = KittyInterface(_address);
}
Ownable Contracts相关推荐
- 《solidity学习笔记》chapter 3-solidity其他知识
Ownable contracts OpenZeppelin Solidity库里的合约之一,可以通过继承使用. /*** @title Ownable* @dev The Ownable contr ...
- 一步步构建自己的智能合约
大爱loom!大爱loom!内容整理自loom僵尸小游戏课程 一.合约 所有的 Solidity 源码都必须冠以 "version pragma" - 标明 Solidity 编译 ...
- 区块链论文研读12:谨慎日志合约 Discreet Log Contracts,详细 清晰 通俗易懂
今天讲的论文来自MIT的Digital Currency Initiative, 名字叫<Discreet Log Contracts>https://adiabat.github.io/ ...
- Reversing Ethereum Smart Contracts: Part 2
In my previous tutorial, we began reversing engineering the Greeter.sol contract. Specifically, we l ...
- Part 1 — Introduction to Smart (legal?) Contracts
A version of this article first appeared in Coindesk on April 11, 2016. Encouraged by the feedback t ...
- Part 2 — Making Sense of Smart Contracts
The term "smart contract" has no clear and settled definition. The idea has long been hype ...
- Understanding Ethereum Smart Contracts
You might have heard the term "smart contract," and you might even know that they are &quo ...
- How to Secure Your Smart Contracts: 6 Solidity Vulnerabilities and how to avoid them (Part 2)
While Part 1 discussed some more high profile or obvious vulnerabilities, this post will be about vu ...
- How to Secure Your Smart Contracts: 6 Solidity Vulnerabilities and how to avoid them (Part 1)
In a previous post we discussed the future of Ethereum's scalability by analyzing the concepts prese ...
最新文章
- 虚拟电脑键盘app_说到弹吉他,这几个APP你一定用得上
- Java转型(向上或向下转型)
- Mybatis学习笔记(1)——第一个程序
- pytorch torch.item()(返回此张量的值作为标准Python数字。 这仅适用于具有一个元素的张量。)
- php+curlmultiinit_多线程 - PHP的curl_multi_init并发测试问题
- P1772 [ZJOI2006]物流运输 最短路+DP
- cmap参数 plt_Matplotlib入门-5-plt.scatter( )绘制散点图
- Qt 程序打包发布总结
- 网络基础2-2(传输层,端口,详谈UDP)
- 微信小程序入门一: 简 介、文本、事件、样式
- mysql索引创建及使用注意事项
- FCGF论文阅读笔记
- java根据模板导出pdf,java开发面试笔试题
- struts2 action 中autowired 不能注入
- Gmail priority inbox帮助你减少工作量
- Linux虚拟化技术KVM入门必看
- SouthidcEditor编辑器如何支持上传png图片
- 【06月25日】指数估值排名
- 【微信防封域名】【微信不死域名】【微信域名白名单】
- 从特斯拉AI团队学到的九条方法论
热门文章
- Mac 下两款 Markdown 编辑器 Mou/MacDown 大 PK
- 【RTC直播】各家rtc sdk 和demo调研 (待续)
- CSDN 联合 18 家大厂招聘直播,10 小时突破百万热度
- 免费参加全球最大的Spark+AI峰会(Databricks 2020年6月22-26日)!免费访问峰会主题演讲及分组会议!
- C# 保护进程不被结束(源代码)防任务管理器结束进程
- 关于java通过System.setProperty设置环境变量作用范围验证
- 颠覆OLED的技术:石墨烯将大规模应用
- 1-树莓派及配件购买推荐
- 微信公众号自定义菜单关联小程序
- 2019c语言程序设计试题答案,2019年C语言程序设计期末考试试题及其答案【Word版资料】...