美食网站首页怎么做动态广告怎么做出来的

张小明 2026/3/12 13:38:40
美食网站首页怎么做,动态广告怎么做出来的,wordpress 整合phpwind,专门做酒的网站有哪些1-Libraries Libraries(库)与智能合约类似,但是不能声明任何静态变量,也不能发送ETH。 Library | Solidity by Example | 0.8.26 如何创建一个库? 建立文件PriceConverter.sol,回到FundMe.sol文件中,复制最后三个函数直接放入PriceConverter.sol中。 那么现在Price…1-LibrariesLibraries(库)与智能合约类似,但是不能声明任何静态变量,也不能发送ETH。Library | Solidity by Example | 0.8.26如何创建一个库?建立文件PriceConverter.sol,回到FundMe.sol文件中,复制最后三个函数直接放入PriceConverter.sol中。那么现在PriceConverter.sol,现在只关注getConversionRate函数就可以://SPDX-License-Identifier: MIT pragma solidity ^0.8.30; import "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol"; //直接导入 library PriceConverter { // 所有库中的函数都必须是internal,让库中的不同函数都可以被uint256调用 function getPrice() internal view returns(uint256) { // conver msg.value to USD // need two thing: ABI Address(0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43) // AggregatorV3Interface(0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43).version(); AggregatorV3Interface priceFeed = AggregatorV3Interface(0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43); (,int256 price,,,) = priceFeed.latestRoundData(); //price:BTC in terms of USD // 9033.148958846, remenber: priceFeed 返回的值中有八个是在小数点之后的(from function decimal:AggregatorV3Interface.sol) return uint256(price * 1e10); // 1e10 == 1**10 == 10000000000 } function getVersion() internal view returns (uint256) { AggregatorV3Interface priceFeed = AggregatorV3Interface(0x1b44F3514812d835EB1BDB0acB33d3fA3351Ee43); return priceFeed.version(); } function getConversionRate(uint256 ethAmount) internal view returns (uint256) { uint256 ethPrice = getPrice(); uint256 ethAmountInUsd = (ethPrice * ethAmount) / 1e18; return ethAmountInUsd; } }FundMe.sol改为如下样式:// Get funds from users // Withdraw funds // Set a minimum funding value in USD // SPDX-License-Identifier: MIT pragma solidity ^0.8.30; import "./PriceConverter.sol"; //直接导入 contract FundMe { using PriceConverter for uint256; // uint256 public number; uint256 public minimumUsd = 50 * 1e18; //最小USD金额为美金计算 address[] public funders; //记录每个捐款人 mapping (address = uint256) public addressToAmountFunded; //记录每个地址发送资金的数量 function fund() public payable { // want to be able to set a minimum fund amount in USD // 1. How do we send ETH to this contract? // 如果要求至少发送 1 ether ,关键词 require 会检查 msg.value 是否大于 1 // require(msg.value 1e18 , "Didn't send enough!"); //1e18 == 1*10**18 == 1000000000000000000 wei == 1 ether,value单位为ETH require(msg.value.getConversionRate() = minimumUsd , "Didn't send enough!"); //如何将ether转换为usd?这就是oracles的作用 //msg.value:18 decimals funders.push(msg.sender); addressToAmountFunded[msg.sender] = msg.value; // What is reverting? // undo any action before, and send remaining gas back // number = 5; // 如果fund函数运行成功,那么number = 5,运行失败则整个函数回滚,number = 0, 消耗的gas也会原
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

摄影手机网站模板可以自己免费做的软件

Ubuntu社区:团队、流程与参与指南 1. Ubuntu社区治理结构 Ubuntu社区拥有一套完善的治理结构,主要包括社区委员会、技术委员会以及其他多个理事会和董事会。 1.1 社区委员会(Community Council) 社区委员会目前有四位Canonical员工,分别是Shuttleworth、Albisetti、Cz…

张小明 2026/3/11 19:29:27 网站建设

什么是网站组件同ip网站做排名seo

一、Pod优先级优先级是什么?优先级代表一个Pod相对其他Pod的重要性优先级有什么用优先级可以保证重要的Pod被调用运行如何使用优先级和抢占配置优先级类PriorityClass创建Pod是为其设置对应的优先级PriorityClassPriorityClass是一个全局资源对象,它定义…

张小明 2026/3/11 19:29:20 网站建设

模块建站工具广告公司名字大全最新

多组学联合分析植物抗逆机制,是比较常见的研究方向,但是如何达到子刊水平呢?今天我们就来聊聊子刊水平的抗逆研究包括哪些内容?以小麦为研究对象,探究土壤、根际和根内的微生物、代谢组与抗旱之间的相互作用。通过16s、…

张小明 2026/3/11 19:29:14 网站建设

深圳做网站什么公司好莱芜市城乡建设局网站

本文将探讨 Kubernetes 中的网络模型,以及对各种网络模型进行分析。 Underlay Network Model 什么是 Underlay Network 底层网络 Underlay Network 顾名思义是指网络设备基础设施,如交换机,路由器, DWDM 使用网络介质将其链接成的物理网络…

张小明 2026/3/11 19:29:08 网站建设

兰州网站seo公司优秀网站建设官网

智能物联与流程引擎双轮驱动:yudao-cloud v2.4.2如何重塑企业数字化运营 【免费下载链接】yudao-cloud ruoyi-vue-pro 全新 Cloud 版本,优化重构所有功能。基于 Spring Cloud Alibaba MyBatis Plus Vue & Element 实现的后台管理系统 用户小程序&…

张小明 2026/3/11 19:29:02 网站建设

安康做网站电话南宁seo按天收费

Linly-Talker 结合 Redis 缓存机制提升高并发响应能力 在直播带货、智能客服、在线教育等场景中,数字人正从“能说会动”的技术演示走向真正的商业落地。用户不再满足于静态播报,而是期待一个反应迅速、表达自然、具备上下文理解能力的虚拟角色。Linly-T…

张小明 2026/3/5 4:08:00 网站建设