sodility合约审计入门学习思路 零基础一

访客 阅读:22 2024-06-24 12:14:31 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

Solidity 是一门面向合约的、为实现智能合约而创建的高级编程语言。这门语言受到了 C++,Python 和 Javascript 语言的影响,设计的目的是能在 以太坊虚拟机(EVM) 上运行。

Soliity is a contract-oriented, advanced programming language created to achieve a smart contract. This language is influenced by the C++, Python and Javascript languages and is designed to run on the Etherm Virtual Machine (EVM).

发现越来多的人关注btc、eth相关的区块链知识,可能大家都幻想过找到一个合约漏洞,发一笔横财哈哈。
网上的学习资料杂而乱,再这里给大家提供一个sodility合约审计的学习思路,让大家少走弯路。
学习一个新技能,肯定要花不少时间,希望大家坚持下去,肯定会有收获。

Discovering that more and more people are interested in btc and eth-related block chain knowledge, everyone may have fantasized finding a contract gap and making a deal. The
web-based learning material is a mess, and here we offer you a sense of study in contract auditing, so that you can keep your head off the curve.
Learning a new skill must take a lot of time and hope that you will stay the course.

下面的链接部分需要科学上网,这里就不教大家了,自己去准备。
1、谷歌浏览器,自行下载安装
2、链接:remix
此网站用于合约的编译、部署、测试(常用,做笔记,收藏下来),不想用网页的也可以在本地搭建。
链接:remix使用
此网站介绍怎么样使用remix,新版本可能界面做了变化,对应是去找到功能位置就行。

The following links require scientific access, and the following links are not taught here to be prepared.
1, Google Browser, to download and install
2, links: , which is used to compile, deploy, test (commonly used, take notes, collect) contracts, or to install them locally. , links: , which describes how to use remix, the interface of the new version may be changed to find a functional location. , links:

3、metamask(谷歌浏览器插件,eth钱包)
链接:
MetaMask的安装与使用
图片: Alt
后面使用remix审计合约会用到,自行下载(需要科学上网)。

>Metamask installation and use of pictures: , download from

 
 

这相当于新学习一门编程语言,他跟py、c++等语言有很多类似的地方,如果你有编程基础这将极其的简单。
没编程基础的同学也不要担心,毕竟我学习的时候也是没有任何基础的,大概你需要一个星期来熟悉solidity

It's like learning a new programming language, and he's got a lot like py, c++, which would be extremely simple if you had a programming base. And don't worry about students who don't have a programming basis. After all, there's no basis for me to study.

学习基础网站
链接: sodility最新中文文档
网站介绍语言的基础语法和各函数的创建和使用,这是合约的基础必须要仔细读懂,因为这部分比较枯燥,所以建议大家和第2步骤一起学习,就是一边看中文文档,一边写合约,这样交替会比较容易学的。(我就是这样学的,嘿嘿)

The basic learning website
links: the latest Chinese document br> describes the creation and use of the basic grammar and functions of languages, which is the basis of the contract, since this part is boring, so it is recommended that you learn together with step 2, that you read Chinese documents and write contracts, which is easier to learn. (I learned that way, hey)

编写练习solidity,这是必须要自己动手去敲键盘才能熟悉,没什么捷径。
链接: solidity编写学习
此网站是用来模拟编写合约,有详细教程,零基础,适合初学者,你可以先完成此教程,然后在到remix上编写自己的合约,进行调试部署。

Practice exercises solidity, which is not a shortcut to be familiar with.
Link: learningbr>. This website is used to simulate contracts, have a detailed curriculum, have a zero basis, are suitable for beginners, and you can finish the lesson and then write your own contract on remix for a trial deployment.

本节主要讲解常见的合约漏洞类型。

This section focuses on the common types of contract gaps.

  • 1、竞争条件引发
    • 1.1 重入漏洞
    • 1.2 交易顺序依赖攻击
  • 2、整型溢出
    • 2.1 乘法溢出
    • 2.2 减法溢出
    • 2.3 加法溢出
    • 2.4 其他可能溢出的情况
    • 2.5 漏洞修复
  • 3、拒绝服务攻击(dos)
    • 3.1 通过(Unexpected) Revert发动DoS
    • 3.2 通过区块Gas Limit发动DoS
    • 3.3 所有者操作
  • 4、区块参数依赖(dos)
    • 4.1 时间戳依赖
    • 4.2 区块哈希依赖
    • 4.3 漏洞修复
  • 5、ecrecover 未作0地址判断
    • 5.1 重放攻击
  • 6、底层函数误用
    • 6.1 call注入攻击
    • 6.2 delegatecall误用
  • 7、tx.origin使用错误
  • 8、re-approve漏洞
  • 9、强行将以太币置入合约
  • 10、短地址/参数攻击
  • 11、使用未初始化的存储器局部变量
  • 12、合约继承中的变量覆盖问题
  • 13、浮点和精度
  • 14、外部合约调用
  • 15、发送和接收以太币存在的安全风险
  • 16、读取合约的状态变量
  • 17、开发人员失误导致的安全风险
    -17.1逻辑判断错误
    -17.2合约权限不符
    -17.3构造函数失配
    -17.4假充值:transfer/transferFrom执行失败未抛出异常
    -17.5合约实现与设计不符

1.1重入漏洞:
以太坊智能合约的特点之一是能够调用和利用其他外部合约的代码,调用外部合约主要存在的危险就是外部合约可以接管控制流,并对调用函数不期望的数据进行更改。这类漏洞有多种形式,包括重入和交易顺序依赖等。
合约通常也处理 Ether,因此通常会将 Ether
发送给各种外部用户地址。调用外部合约或将以太网发送到地址的操作需要合约提交外部调用。这些外部调用可能被攻击者劫持,迫使合约执行进一步的代码(即通过回退函数),包括回调自身。因此代码执行"重新进入"合约。这种攻击被用于臭名昭著的DAO 攻击。
下面展示 .

1.1 Re-entry holes: (br>) One of the features of the Taiyo Smart Contract is that it is able to call and use the code of other external contracts, and the main risk of calling external contracts is that the external contract can take control of the flow and change the data that calls functions that are not expected. There are many forms of these loopholes, including re-entry and transaction sequence dependence. Shows below.


                												

文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明 网址:https://netpsp.com/?id=69029

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
可以去百度分享获取分享代码输入这里。
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
关注我们

若遇到问题,加微信客服---清歌

搜索
排行榜
扫一扫,加我为微信好友加我为微信好友