再读Solidity官网文档 1

Solidity官方文档中文版 以太坊智能合约的高级开发语言Solidity的官方文档的中文版本。必备。 立即下载

由于solidity英文描述,所以每次读理解就有点不一样,领会的更多.比如: 

1. 区块链和交易

A blockchain is a globally shared, transactional database. This means that everyone can read entries in the database just by participating in the network. If you want to change something in the database, you have to create a so-called transaction which has to be accepted by all others. The word transaction implies that the change you want to make (assume you want to change two values at the same time) is either not done at all or completely applied. Furthermore, while your transaction is being applied to the database, no other transaction can alter it.

区块链是一个全局共享的,存储交易的数据库。(精辟)   意味着每个人可以通过加入区块链节点网络读取数据库里面的条目.  如果你想改变数据库里面的某些东西,你不得不创建一个必须被所有其他节点接受的"交易"。 交易(Transaction)这个词意味着你想对数据库做的改变要么完全无效,要么被完全接受。 进一步说,一旦你的交易被应用到数据库,将不会被其他交易所改变。

2.区块

One major obstacle to overcome is what (in Bitcoin terms) is called a “double-spend attack.

对区块链来说,需要攻克的最重要的障碍是双花.

Transactions are not guaranteed to be included in the next block or any specific future block, since it is not up to the submitter of a transaction, but up to the miners to determine in which block the transaction is included.

交易不能被保证一定会包含在下一个区块里面,或者特定的未来某个区块里. 因为这并不是取决于交易的提交者而是取决于矿工,矿工决定交易会被包含在那一个区块里.

3.The Ethereum Virtual Machine

在以太坊链中, EVM是合约的运行环境.

It is not only sandboxed but actually completely isolated, which means that code running inside the EVM has no access to network, filesystem or other processes. Smart contracts even have limited access to other smart contracts.

Evm 不仅是沙盒而且还完全隔离,意味着代码运行的环境没有网络权限,没有文件系统访问权限,没有其他进程访问权限。合约甚至限制访问其他合约。

4. Accounts

账户分两类: 外部账户. 合约账户.

外部账户: 公私钥控制的账户.    地址由公钥衍变而来.

合约账户: 被合约代码控制.  合约代码和account一起存储.  合约地址是在合约创建的时候确定(由合约创建者地址address和nonce决定)

Regardless of whether or not the account stores code, the two types are treated equally by the EVM.

无论account是否存储代码(无论外部账户和合约账户),两种类型被Evm同等对待.

Every account has a persistent key-value store mapping 256-bit words to 256-bit words called storage.

每一个账户有一个持久性key-value 对象storage,  映射256位字符到256位字符.

Furthermore, every account has a balance in Ether (in “Wei” to be exact, 1 ether is 10**18 wei) which can be modified by sending transactions that include Ether.

进一步说, 每一个账户有一个eth余额,可以被包括eth的交易来修改.

5.Transactions

A transaction is a message that is sent from one account to another account (which might be the same or empty, see below). It can include binary data (which is called “payload”) and Ether.

一个交易是一个message,  可以从一个账户发送到另一个账户。它可以包含二进制数据(payload)和eth.

If the target account contains code, that code is executed and the payload is provided as input data.   如果目标账户包括代码, 这些代码会被执行并且payload会作为输入参数。

If the target account is not set (the transaction does not have a recipient or the recipient is set to null), the transaction creates a new contract. 

如果目标账户没有设置,(交易里面没有接收人或者接收人被设置成null), 这个交易将创建一个新的合约。 合约地址由交易发送者和nonce共同衍生而来。

The payload of such a contract creation transaction is taken to be EVM bytecode and executed. The output data of this execution is permanently stored as the code of the contract. This means that in order to create a contract, you do not send the actual code of the contract, but in fact code that returns that code when executed.

创建合约的交易的payload 被作为Evm的字节码执行,执行输出数据被永久的作为合约代码存储。这意味着为了创建一个合约, 你没有发送实际的合约代码,而是当执行完payload后的的代码。

While a contract is being created, its code is still empty. Because of that, you should not call back into the contract under construction until its constructor has finished executing.

当合约刚被创建, 合约的代码依然是空的。由于这个,你不应该在合约构造函数执行完成前调用合约的任何方法。 

6. GAS 费用.

Upon creation, each transaction is charged with a certain amount of gas that has to be paid for by the originator of the transaction (tx.origin)

创建后,每笔交易都会收取一定数量的天然气,这些天然气必须由交易发起人支付(tx.origin)

While the EVM executes the transaction, the gas is gradually depleted according to specific rules. If the gas is used up at any point (i.e. it would be negative), an out-of-gas exception is triggered, which ends execution and reverts all modifications made to the state in the current call frame.

当虚拟机执行交易的时候, gas会根据特定的规则被逐渐消耗枯尽。 如果gas在执行过程中的任意一个点耗尽,一个out-of-gas异常会被触发,接着结束往下执行,回滚当前调用帧中的所有的修改状态。

This mechanism incentivizes economical use of EVM execution time and also compensates EVM executors (i.e. miners / stakers) for their work. Since each block has a maximum amount of gas, it also limits the amount of work needed to validate a block.

这个机制激励着经济的使用EVM执行时间 和 为EVM的执行者(矿工或质押者)的工作进行补偿。

由于每一个区块拥有最大数量的gas的设置, 意味着验证区块的工作量也是受到限制的。

Since EVM executors can choose to include a transaction or not, transaction senders cannot abuse the system by setting a low gas price.

由于EVM 执行者打包时,可以去选择去包含一个交易或者不包含, 交易发送者不会设置一个非常低的gasprice去滥用系统.

7. Storage(存储), Memory(内存) and the Stack(栈)

Each account has a data area called storage.

每一个账户有一个数据区域,叫 storage 存储.是函数间互相调用的存储. storage是一个256位和256位之间的key-value间的映射.

It is not possible to enumerate storage from within a contract, it is comparatively costly to read, and even more to initialise and modify storage. 

在合约内部枚举storage是不可能的, 因为读取将会使用相对高的开销花费, 初始化和修改会开销更多。

 Because of this cost, you should minimize what you store in persistent storage to what the contract needs to run.  正因为开销,你应该最小化的持久化数据到storage, 只存储合约需要运行的数据。

Store data like derived calculations, caching, and aggregates outside of the contract. A contract can neither read nor write to any storage apart from its own.

所以要在合约外,进行存储数据的计算,缓存和累计计算。 一个合约除了它自己的storage, 不能任意的读取其他的账户的storage.

 

The second data area is called memory,  第二个数据区域叫做内存。每次一个消息调用都会获取一个全新的memory.

Memory is linear and can be addressed at byte level, but reads are limited to a width of 256 bits, while writes can be either 8 bits or 256 bits wide.

内存是一个线性的数据结构,可以在字节层面进行地址标记,但是读取宽度被限制在256位. 写的宽度可以是8位或256位.

Memory is expanded by a word (256-bit), when accessing (either reading or writing) a previously untouched memory word (i.e. any offset within a word). At the time of expansion, the cost in gas must be paid. Memory is more costly the larger it grows (it scales quadratically).

当访问(读取或写入)先前未被触及的存储器字(即,字内的任何偏移)时,存储器扩展一个字(256位)。在扩建时,必须支付天然气成本。内存增长得越大,成本就越高(按二次方扩展)。

The EVM is not a register machine but a stack machine, so all computations are performed on a data area called the stack. 

虚拟机EVM 不是一个注册机而是一个堆栈机, 所以所有的计算将在stack(栈)里面执行.

Access to the stack is limited to the top end in the following way: It is possible to copy one of the topmost 16 elements to the top of the stack or swap the topmost element with one of the 16 elements below it. 

通过以下方式访问堆栈仅限于顶端:可以将最顶层的16个元素中的一个复制到堆栈顶部,也可以将最高层的元素与其下方的16个元件中的一个中交换。

All other operations take the topmost two (or one, or more, depending on the operation) elements from the stack and push the result onto the stack. 所有其他操作都从堆栈中获取最上面的两个(或一个,或多个,具体取决于操作)元素,并将结果推送到堆栈上。

Of course it is possible to move stack elements to storage or memory in order to get deeper access to the stack, but it is not possible to just access arbitrary elements deeper in the stack without first removing the top of the stack.

为了获取更深层的栈数据,移动栈数据到storage或memory中是可行的。 如果不先移除栈顶数据,就访问栈栈底部数据,是不可能的。

Instruction Set 指令集

The instruction set of the EVM is kept minimal in order to avoid incorrect or inconsistent implementations which could cause consensus problems.  为避免不正确的或不一致的引起共识问题的实践,EVN虚拟机指令集保持一个最新的数量.

Message Calls 

Contracts can call other contracts or send Ether to non-contract accounts by the means of message calls.  合约可以调用其他合约,或发送eth给其他非合约地址通过消息调用,Message calls. 

Message calls are similar to transactions, in that they have a source, a target, data payload, Ether, gas and return data.  Message Call 跟交易很相似, 它里面也有源头source, target目标,data payload 请求数据, eth, gas, 返回数据.

In fact, every transaction consists of a top-level message call which in turn can create further message calls.事实上,每个事务都由一个顶级消息调用组成,该消息调用又可以创建更多的消息调用。

As already said, the called contract (which can be the same as the caller) will receive a freshly cleared instance of memory and has access to the call payload - which will be provided in a separate area called the calldata. After it has finished execution, it can return data which will be stored at a location in the caller’s memory preallocated by the caller. All such calls are fully synchronous.

正如已经说过的, 被调用合约(或者调用合约)会接收到一个全新的内存空间,并且有权限访问payload数据,  payload存储在单独的叫做calldata的区域.  在它完成执行之后, 返回数据将会存储在调用者之前分配好的内存空间中.   这些调用都是异步的.

Calls are limited to a depth of 1024, which means that for more complex operations, loops should be preferred over recursive calls. Furthermore, only 63/64th of the gas can be forwarded in a message call, which causes a depth limit of a little less than 1000 in practice.

调用的深度限制为1024,这意味着对于更复杂的操作,循环应该优先于递归调用。此外,在消息调用中只能转发63/64的气体,这在实践中导致深度限制略小于1000。

Delegatecall and Libraries

There exists a special variant of a message call, named delegatecall which is identical to a message call apart from the fact that the code at the target address is executed in the context (i.e. at the address) of the calling contract and msg.sender and msg.value do not change their values.  这里存在一种特殊的变种的消息调用,叫代理调用delegatecall,   代理调用是被认为是一种消息调用---目标地址合约代码在调用合约的上下文中执行, msg.sender和msg.value 没有改变.

This means that a contract can dynamically load code from a different address at runtime. Storage, current address and balance still refer to the calling contract, only the code is taken from the called address. 这意味着一个合约可以从不同的合约地址里面加载它们的代码到自己的运行环境里。存储,当前地址, 余额仍然指向调用合约,仅仅是把被调用合约的代码加载过来。

This makes it possible to implement the “library” feature in Solidity: Reusable library code that can be applied to a contract’s storage, e.g. in order to implement a complex data structure.

这个机制为Solidity实现了library功能提供了可能: 可重复利用的库代码可以被应用到合约的数据上, 实现一个复杂的数据结构。

 Logs

It is possible to store data in a specially indexed data structure that maps all the way up to the block level.   把数据存储到特定的索引数据结构中直到映射到块级别是一个可能。

Create

Contracts can even create other contracts using a special opcode (i.e. they do not simply call the zero address as a transaction would).  合约设置可以通过特定的opcode去创建一个新合约.

The only difference between these create calls and normal message calls is that the payload data is executed and the result stored as code and the caller / creator receives the address of the new contract on the stack.     创建调用call和普通的消息call的区别是payload执行完成结果作为代码存储,创建者或调用者接收到一个新合约的地址。

Deactivate and Self-destruct

 The only way to remove code from the blockchain is when a contract at that address performs the selfdestruct operation.  唯一的从链上移除代码的方法是合约执行selfdestruct 操作.

The remaining Ether stored at that address is sent to a designated target and then the storage and code is removed from the state. Removing the contract in theory sounds like a good idea, but it is potentially dangerous, as if someone sends Ether to removed contracts, the Ether is forever lost. 剩余的eth会被发送到提前设置好的目标地址里面,  storage,代码将从state里面移除。移除合约理论上听起来很好,但是有潜在风险, 如果有人发送eth到移除的合约中,eth将永远消失.

Even if a contract is removed by selfdestruct, it is still part of the history of the blockchain and probably retained by most Ethereum nodes. So using selfdestruct is not the same as deleting data from a hard disk.

虽然合约通过selfdestruct移除了, 但是依然是区块链的历史一部分,很可能被大多数eth nodes持有. 所以selftdestruct跟从磁盘上删除的概念是完全不一样的。

If you want to deactivate your contracts, you should instead disable them by changing some internal state which causes all functions to revert. This makes it impossible to use the contract, as it returns Ether immediately. 

如果你想deactivate你的合约,你通过应该改变他们的内部状态从而使所有的函数revert达到disable它, 这使的无法使用这个合约,因为它会立即返回eth.

Precompiled Contracts

There is a small set of contract addresses that are special: The address range between 1 and (including) 8 contains “precompiled contracts” that can be called as any other contract but their behaviour (and their gas consumption) is not defined by EVM code stored at that address (they do not contain code) but instead is implemented in the EVM execution environment itself.

EVM 系统合约, 预编译合约,在EVM 执行环境本身去执行,不受gas的影响.

solidity官方文档中文版 github项目合成pdf, 不可用于商业目的,不可用于商业目的。 立即下载

相关推荐

solidity-doc-cn:以太坊Solidity语言中文文档

团结中文文档 工作指南 Github使用基础 看到廖雪峰的 RST文档基础 RST文档格式的一个 工作流 参见当前目录下文档: translation_process.md 工作进度 参见当前目录下文档: status.md 常见问题 fork出的仓库如何同步源的内容: : 如何检查文件(参考)的提交哈希: git log filename.rst 文档如何合并: ://solidity-cn.rtfd.io是我们的托管地址,readthedocument这个网站是免费的,可以关联多个仓库,并且可以由git push触发自动构建,以达到文档更新的目的。 原中文文档更新怎么办:我们需要人去

Solidity 官方文档中文版(一)

中文翻译文档:http://www.tryblockchain.org/Solidity-%E8%AF%AD%E8%A8%80%E4%BB%8B%E7%BB%8D.html英文官方文档:http://solidity.readthedocs.io/en/develop/Solidity是一种智能合约高级语言,运行在Ethereum虚拟机(EVM)之上。Solidity与其它语言相关的特点?它的语法...

xiatiancc的专栏 1万+

华为昇腾310P3+deepseek蒸馏版性能调优:FP16精度优化全记录

本文详细介绍了在华为昇腾310P3硬件环境下优化DeepSeek蒸馏版模型FP16精度的关键技术路径。通过分层量化策略、内存分配优化和并行计算配置,显著提升模型推理性能,实现83%的并发处理能力提升,同时保持98.7%的原始模型准确率。

weixin_29074409的博客 348

Solidity一篇就够了

ERC全称是 “”,表示以太坊的意见征求稿,ERC中包含技术和组织等注意事项及标准。这套标准其实不光由以太坊官方提出,还有一些以太坊爱好者提出。是以太坊生态系统中被广泛使用的关键标准。什么叫做代币?彩票卷像美元一样的法定货币在线平台中的信誉积分游戏中一个角色的技能一盎司黄金及更多…ERC-20 提出了一个同质化代币的标准,换句话说,它们具有一种属性,使得每个代币都与另一个代币(在类型和价值上)完全相同。

梅山老妖的博客 1634

【Docker】搭建一个媒体服务器插件后端API服务 - MetaTube

本教程基于群晖的NAS设备DS423+的docker功能进行搭建,DSM版为 7.2.1-69057 Update 5。MetaTube是一个媒体服务器插件,主要用于Emby和Jellyfin媒体服务器。它的主要功能是从互联网上抓取内容并响应 JSON 数据,然后通过预安装的 MetaTube 插件请求服务器并下载相应的元数据,以与 Jellyfin/Emby 服务器配合使用。使用 MetaTube 的步骤大致如下:部署后端:首先,需要部署一个名为​ 的后端 API 服务器来抓取内容。

小小笔记大大用处 1万+

云架构师进阶【SAP迁移方案设计】手把手教您玩转SAP上云

一,项目背景介绍 今天又接到了北京某制造企业SAP迁移的场景,先简单说明一下,好好的SAP在运行着为什么要做迁移这类大动作呢?众所周知SAP的ERP是企业的绝对核心系统,尤其对于制造业更是核心的系统,这样一套核心系统还是生产环境在迁移的过程中必然要面临比较大的挑战,如果有任何问题的话,都会对企业的绩效产生很大的影响。 经过跟客户沟通才得知,客户的SAP原来的系统是托管在运营商机房里,近期感染了勒索病毒,导致业务宕机,SAP应用服务器无法启动,仅有的数据库服务器可以运行。基于上述情况公司领导当机立断决定迅

bdsh818的博客 4220

Solidity 官方文档中文版(二)

Solidity AssemblySolidity定义了一个汇编语言,可以不同Solidity一起使用。这个汇编语言还可以嵌入到Solidity源码中,以内联汇编的方式使用。下面我们将从内联汇编如何使用着手,介绍其与独立使用的汇编语言的不同,最后再介绍这门汇编语言。文档尚待完善的补充的地方:待补充内联汇编的变量作用域的不同,尤其是使用含internal的函数的库时所引入的复杂度。另外,还需补充,编...

xiatiancc的专栏 9859

通过两个mark点确定某一个点的位置

read_image (Image0, '0.bmp') binary_threshold (Image0, Region, 'max_separability', 'dark', UsedThreshold) connection (Region, ConnectedRegions) fill_up (ConnectedRegions, RegionFillUp) select_shape_std (RegionFillUp, SelectedRegions, 'max_area', 70) red...

优快云博客 3889

Solidity 官方文档中文版(四)

数据位置(Data location)复杂类型,如数组(arrays)和数据结构(struct)在Solidity中有一个额外的属性,数据的存储位置。可选为memory和storage。memory存储位置同我们普通程序的内存一致。即分配,即使用,越过作用域即不可被访问,等待被回收。而在区块链上,由于底层实现了图灵完备,故而会有非常多的状态需要永久记录下来。比如,参与众筹的所有参与者。那么我们就要...

xiatiancc的专栏 4316

异构图中的注意力机制网络:节点级别和语义级别的注意力(Python实现)

在本文中,我们介绍了如何使用Python实现异构图中的节点级别注意力和语义级别注意力。通过语义级别注意力,我们可以根据节点的语义信息对节点进行加权聚合。在本文中,我们将介绍如何使用Python实现异构图中的注意力机制网络,包括节点级别的注意力和语义级别的注意力。最后,我们使用注意力权重对节点特征进行加权聚合,得到聚合后的节点表示。然后,将聚合后的节点表示传递给语义级别注意力模型,根据节点的语义信息进行加权聚合,得到最终的表示。函数中,首先使用节点级别注意力模型对节点特征进行聚合,得到聚合后的节点表示。

HackNebulaZ的博客 485

车规SoC深度对比:高通8397 vs 比亚迪D9000 vs 联发科CT-X1/MT8676/MT2715

芯片优势弱势最适合场景高通 8397低功耗、低延迟AI和音频处理单屏算力略低HUD + 音响座舱 + 低延迟交互D9000多屏渲染、Wi-Fi7高速通信AI算力中等高端多屏座舱 + 流媒体娱乐CT-X1极高AI算力、多模态渲染功耗较高高端沉浸式智能座舱 + 多摄像头感知MT8676算力均衡、座舱应用全面GPU稍弱全栈智能座舱、音视频多任务MT2715成本低、入门座舱可用算力低,低端显示入门智能座舱、基础信息娱乐。

weixin_43199439的博客 1769

Solidity 官方文档中文版(三)

赋值(Assignment)解构赋值和返回多个结果(Destructing Assignments and Returning Multip Values)Solidity内置支持元组(tuple),也就是说支持一个可能的完全不同类型组成的一个列表,数量上是固定的(Tuple一般指两个,还有个Triple一般指三个)。这种内置结构可以同时返回多个结果,也可用于同时赋值给多个变量。pragma so...

xiatiancc的专栏 1913

YOLOv8的二次创新 | 结合iRMB与EMA打造全新的iEMA机制,提升动态检测性能【附保姆级代码】

YOLOv8继承了YOLO系列的轻量化和高效检测特性,同时通过改进的架构设计使得其在实时场景下具有更高的检测精度。然而,随着检测需求的增加,尤其是在动态目标检测和长时间序列检测中,YOLOv8的鲁棒性依然可以提升。通过iEMA机制的引入,我们将在这些方面进行进一步优化。iRMB模块是我们对传统Residual Block的进一步改进。通过多层特征提取,iRMB能够捕捉更多层次的特征信息,并通过引入轻量化的残差结构,提升计算效率。

一键难忘的博客 3085

智能合约-Solidity官方文档(1)

写在前面:HiBlock区块链社区成立了翻译小组(以太坊中文社区),翻译区块链相关的技术文档及资料,本文为solidity官方文档翻译的第一部分《智能合约概述》,特发布出来邀请solidity爱好者、开发者做公开的审校,您可以添加微信baobaotalk_com,验证输入“solidity”,然后将您的意见和建议发送给我们,也可以在文末“留言”区留言,有效的建议我们会采纳及合并进下一版本,同时将...

weixin_34013044的博客 598

Android Audio录音——AudioRecord回声消除(九)

在语音通话或录音场景中,回声(Acoustic Echo)通常是指说话的声音从对方的扬声器播放出来,又被对方的麦克风拾取,然后有被传回来,导致我们听到了自己延迟了一段时间的重复声音。

小旭的专栏 1404

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Solidity 源文件结构解析与智能合约开发入门

基于以太坊的智能合约使用 Solidity 编写,Solidity 是一种高层次的编程语言,设计初衷是能够让开发者在区块链上编写具有任意复杂度功能的代码。以太坊是由维塔利克·布特林提出的去中心化平台,旨在提供一个图灵完备的智能合约平台,让开发者能够在区块链上编写和部署去中心化应用(DApp)。部署合约到以太坊网络是通过发送交易的方式进行的,合约的字节码和构造参数会通过交易发送到网络,部署后会得到一个合约地址,用户可以通过此地址与合约交互。状态变量是保存在区块链上的数据,合约内部可以对其进行修改和查询。

m0_74921950的博客 1139

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Solidity 最新 0.5.8 中文文档发布

本文首发于深入浅出区块链社区 热烈祝贺 Solidity 最新 0.5.8 中文文档发布, 这不单是一份 Solidity 速查手册,更是一份深入以太坊智能合约开发宝典。 翻译说明 Solidity 最新 0.5.8 中文文档 根据当前 最新官方版本v0.5.8 进行翻译,本翻译最初 HiBlock 社区发起,后经过 深入浅出区块链社区 社区成员根据最新版本补充翻译。 大部分的译者,都是国内顶尖的...

weixin_33781606的博客 309

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

根据例子学习Solidity-Solidity官方文档(3)

写在前面:HiBlock区块链社区成立了翻译小组(以太坊中文社区),翻译区块链相关的技术文档及资料,本文为Solidity官方文档翻译的第三部分《根据例子学习Solidity》,特发布出来邀请solidity爱好者、开发者做公开的审校,您可以添加微信baobaotalk_com,验证输入“solidity”,然后将您的意见和建议发送给我们,也可以在文末“留言”区留言,有效的建议我们会采纳及合并进...

weixin_34334744的博客 373

Solidity智能合约中的异常处理error、require、assert

error使用require来检查调用者提供的输入是否有效;使用assert来检测程序逻辑中的不可能情况;使用error来自定义错误消息,以便于调试和错误处理。

以择人之心择己,以恕己之心恕人。 1090

Solidity中文文档(1)-HiBlock区块链社区翻译小组

Solidity 是一门面向合约的、为实现智能合约而创建的高级编程语言。这门语言受到了 C++,Python 和 Javascript 语言的影响,设计的目的是能在以太坊虚拟机(EVM)上运行。Solidity 是静态类型语言,支持继承、库和复杂的用户定义类型等特性。下面您将会看到,使用 Solidity 语言,可以为投票、众筹、秘密竞价(盲拍)、多重签名的钱包以及其他应用创建合约。注解目前尝试 ...

姜信宝 Bob Jiang的专栏 734

Solidity中文文档(内部)

1. 值类型和引用类型 Solidity是一个静态类型的语言,在编译时需要明确指定变量的类型,主要分类值类型,引用类型。 值类型包括: 布尔 整形 地址 定长字节数组 有理数和整型 枚举类型 函数 值类型在传值时,会临时拷贝一份内容出来,而不是拷贝指针,当你修改新的变量时候,原来值不会发生改变。 引用类型包括: 不定长字节数组 字符串 数组 结构体 引用类型,赋值时,我...

boss2967的博客 1060

安装Solidity编译器-solidity中文文档-HiBlock翻译小组

安装Solidity编译器版本Solidity的版本遵循 语义化版本原则,作为发布版本的补充, 每日开发构建 (nightly development builds)也是可用的。这个每日开发构建不保证能正常工作,尽管尽了最大的努力,但仍可能包含未记录的和/或重大的改动。我们推荐使用最新的发布版本。下面的包安装程序将使用最新发布版本。Remix我们推荐使用 Remix 来开发简单合约和快速学习 So...

姜信宝 Bob Jiang的专栏 1615

Solidity 中文文档 —— 第一章:Introduction to Smart Contracts

第一章:智能合约简介 粗略地翻译了 Ethereum 的智能合约开发语言的文档:Solidity。欢迎转载,注明出处。 有任何问题请联系我,本人微信:wx1076869692,更多详情见文末。 我是 JoiT,coding monkey 。最早做 web 开发,用 .net mvc 和 python flask/DJango,后来做微信公众号和小程序开发,现在探

JoiT 1192

Solidity语言基础:区块链智能合约开发入门指南

Solidity是以太坊生态系统中最重要的智能合约编程语言,由Gavin Wood于2014年提出。作为面向合约的高级语言,它结合了JavaScript、Python和C++的语法特点,专为在以太坊虚拟机(EVM)上运行而设计。核心特性静态类型语言支持继承和复杂用户定义类型内置安全功能(如异常处理)直接访问区块链属性(如区块时间戳)

weixin_44727517的博客 4913

风格指南——Solidity中文文档(10)

写在前面:HiBlock区块链社区成立了翻译小组,翻译区块链相关的技术文档及资料,本文为Solidity文档翻译的第十部分《风格指南》,特发布出来邀请solidity爱好者、开发者做公开的审校,您可以添加微信baobaotalk_com,验证输入“solidity”,然后将您的意见和建议发送给我们,也可以在文末“留言”区留言,有效的建议我们会采纳及合并进下一版本,同时将送一份小礼物给您以示感谢。...

weixin_34204057的博客 262

Solidity基础一

Solidity 的 SPDX许可证、Solidity版本声明、Solidity合约声明、Solidity的注释、Solidity的数据类型、Solidity的变量、Solidity的常量、Solidity的标识符、Solidity的关键字、Solidity的运算符

尽欢的博客 1524
上一篇: ChatGPT之深度强化学习DRL理解
下一篇: 再读Solidity官网之闪电网络 2
gridlayout
博客等级 码龄19年 12粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值