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相关推荐

  1. 《solidity学习笔记》chapter 3-solidity其他知识

    Ownable contracts OpenZeppelin Solidity库里的合约之一,可以通过继承使用. /*** @title Ownable* @dev The Ownable contr ...

  2. 一步步构建自己的智能合约

    大爱loom!大爱loom!内容整理自loom僵尸小游戏课程 一.合约 所有的 Solidity 源码都必须冠以 "version pragma" - 标明 Solidity 编译 ...

  3. 区块链论文研读12:谨慎日志合约 Discreet Log Contracts,详细 清晰 通俗易懂

    今天讲的论文来自MIT的Digital Currency Initiative, 名字叫<Discreet Log Contracts>https://adiabat.github.io/ ...

  4. Reversing Ethereum Smart Contracts: Part 2

    In my previous tutorial, we began reversing engineering the Greeter.sol contract. Specifically, we l ...

  5. 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 ...

  6. Part 2 — Making Sense of Smart Contracts

    The term "smart contract" has no clear and settled definition. The idea has long been hype ...

  7. Understanding Ethereum Smart Contracts

    You might have heard the term "smart contract," and you might even know that they are &quo ...

  8. 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 ...

  9. 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 ...

最新文章

  1. 虚拟电脑键盘app_说到弹吉他,这几个APP你一定用得上
  2. Java转型(向上或向下转型)
  3. Mybatis学习笔记(1)——第一个程序
  4. pytorch torch.item()(返回此张量的值作为标准Python数字。 这仅适用于具有一个元素的张量。)
  5. php+curlmultiinit_多线程 - PHP的curl_multi_init并发测试问题
  6. P1772 [ZJOI2006]物流运输 最短路+DP
  7. cmap参数 plt_Matplotlib入门-5-plt.scatter( )绘制散点图
  8. Qt 程序打包发布总结
  9. 网络基础2-2(传输层,端口,详谈UDP)
  10. 微信小程序入门一: 简 介、文本、事件、样式
  11. mysql索引创建及使用注意事项
  12. FCGF论文阅读笔记
  13. java根据模板导出pdf,java开发面试笔试题
  14. struts2 action 中autowired 不能注入
  15. Gmail priority inbox帮助你减少工作量
  16. Linux虚拟化技术KVM入门必看
  17. SouthidcEditor编辑器如何支持上传png图片
  18. 【06月25日】指数估值排名
  19. 【微信防封域名】【微信不死域名】【微信域名白名单】
  20. 从特斯拉AI团队学到的九条方法论

热门文章

  1. Mac 下两款 Markdown 编辑器 Mou/MacDown 大 PK
  2. 【RTC直播】各家rtc sdk 和demo调研 (待续)
  3. CSDN 联合 18 家大厂招聘直播,10 小时突破百万热度
  4. 免费参加全球最大的Spark+AI峰会(Databricks 2020年6月22-26日)!免费访问峰会主题演讲及分组会议!
  5. C# 保护进程不被结束(源代码)防任务管理器结束进程
  6. 关于java通过System.setProperty设置环境变量作用范围验证
  7. 颠覆OLED的技术:石墨烯将大规模应用
  8. 1-树莓派及配件购买推荐
  9. 微信公众号自定义菜单关联小程序
  10. 2019c语言程序设计试题答案,2019年C语言程序设计期末考试试题及其答案【Word版资料】...