当前位置:网站首页>The birth of the cheapswap protocol
The birth of the cheapswap protocol
2022-06-30 02:02:00 【thirty-three thousand three hundred and fifty-seven】
The original is published in https://github.com/33357/smartcontract-apps This is a Chinese community , Analyze the architecture and implementation of smart contract application on the market . Welcome to the open source knowledge project !
CheapSwap The birth of the agreement
Why is there CheapSwap
If you want to withdraw money from a centralized exchange USDT To ETH On the chain , Will be scared by its high handling fees . With Binance For example , Withdrawal ETH To ERC20 Only 1.4 USDT The handling charge , Cash withdrawal USDT To ERC20 But it needs to be whole 10 USDT The handling charge . It's obvious that ,USDT There is no fee for transfer ETH Transfer fee 7 Twice as many , This is what the exchange deliberately set up , Its purpose is to let everyone out USDT Pay more money when you're ready .
However CheapSwap The protocol developers have found loopholes in the embodiment process of the centralized exchange . With Binance For example , When the user withdraws ETH When ,binance Will send a gasLimit by 207128,maxFeePerGas by 102 Of ETH Transfer transaction . The of the deal maxFee the height is 0.021127056 ETH, Much higher than the user's cash withdrawal cost 1.4 USDT.
therefore ,CheapSwap The protocol hopes to exploit this vulnerability , Help users spend only cash ETH To ERC20 The cost of , Cash withdrawal completed USDT To ERC20 The job of .
CheapSwap Protocol principle
CheapSwap The agreement took advantage of Binance Withdrawal ETH The extra service charge you get when you get there , Withdrawal in progress ETH At the same time UNISWAP_V3 Admiral ETH Switch to USDT, And will USDT To the user's account .
In order to achieve this function , Users need to CheapSwapFactory Create a contract account on the contract , This contract will record the user's address and the information that needs to be changed TOKEN Address . Users only need to be in Binance Admiral ETH Withdraw cash to this contract address , All operations will be completed automatically .
CheapSwap The protocol will charge for each call of this function 0.001 ETH The handling charge , To help the development of the agreement .
How to use CheapSwap agreement
open CheapSwapFactory Contract website
https://etherscan.io/address/0xb5852e69be43f4f71fe656144485d2b2675bdb7a#writeContractClick on
connet to web3Connect walletClick on
createTokenOutAddress, Input USDT Contract address0xdAC17F958D2ee523a2206206994597C13D831ec7, Click onwrite, Wait for the wallet to confirm the transaction .Click... After confirming the wallet
read Contract, Click ontokenOutAddressMap, First enter your wallet address , The second input USDT Contract address0xdAC17F958D2ee523a2206206994597C13D831ec7, Click onQuery, Get your ETH Withdrawal address .
5. stay Binance Normal cash withdrawal ETH To Yours ETH Withdrawal address , After the transaction is confirmed, you will get an equal amount of USDT.
CheapSwap The problem of the agreement
CheapSwap agreement At present, it relies on Binance Of ETH Withdrawal vulnerability exists , If Binance Fix the problem ,CheapSwap agreement Need to find another exchange .
Due to the particularity of the transaction on the chain ,CheapSwap agreement Not applicable to large amount USDT Withdrawal . It is recommended that the withdrawal amount be less than 3000 USDT.
CheapSwap The development of the agreement
If Binance Continue to allow CheapSwap The agreement continues to make use of its excess withdrawal costs , that CheapSwap The agreement will continue to support preferential withdrawal in more currencies . If other developers want to take advantage of it ,CheapSwap The agreement will also provide technical support .
Project open source address
CheapSwap The protocol is open source ,github The address is https://github.com/33357/cheap-swap-contract
边栏推荐
猜你喜欢

DTW学习(dynamic time warping)——思想、代码实现

搞透AQS原理(流程圖及同步隊列圖解)

【MySQL 04】使用MySQL Workbench 8.0 CE 备份及恢复Linux中的MySQL数据库

【银河麒麟V10】【桌面】火狐浏览器设置主页不生效

012_ switch

The first technology podcast month will begin soon

What should I do when I feel confused after graduation from university?

手势数字启蒙学习机

一次 Keepalived 高可用的事故,让我重学了一遍它!

Want to change careers, but don't know what you want to do?
随机推荐
What are the payment and distribution systems?
Geotools: common tools for mutual conversion of wkt, geojason, feature and featurecollection
谁再用Redis过期监听实现关闭订单,立马滚蛋!
A summary of the quantification of deep network model
MySQL monitoring
Varnish foundation overview 10
Understand AQS principle (flow chart and synchronous queue diagram)
C语言 写出这个数
Repair method for win10 subsystem WSL if the passwords of root and other users are forgotten
Unity2d-- add keys to animation and bind events
一次 Keepalived 高可用的事故,让我重学了一遍它!
Leetcode 46 Full arrangement (February 15, 2022)
[MRCTF2020]Ezpop-1|php序列化
Local page floating animation is realized with the help of scroll wheel
Is the processor the main factor in buying a mobile phone?
9 — 正则校验集合
Varnish foundation overview 7
云存储架构能解决 DevOps 的什么问题?
C语言 我要通过
Share the source code of the website of graduation student record