区块链
yn00
QQ:253319066
展开
-
Metaverse 元宇宙 Gamefi 链游 NFT 盲盒 质押 私募 众筹 DogeKing 通缩 分红 烧热 模式
最近看到一个开源项目挺有意思的,在他的网站上,你可以制作自己的NFT,可以创建自己的NFT合约,创建标准的Token合约,创建持币分红本合约,创建持币分红其他Token,目前好像只支持BSC网络,看路线图好像后面会有多链,质押Token合约,质押NFT合约,创建私募Token合约,创建私募NFT合约。下面来说说操作步骤。1.制作NFT第一步:上传自己想要制作成NFT的图片,可以是和家人一起开心的图片,自己认为很帅气,很漂亮的图片,也可以是自己心仪对象的图片,可以发挥你的想想,只有你想不到的,没有他做原创 2022-05-04 21:39:49 · 4247 阅读 · 0 评论 -
Mint NFT 在Opensea显示
今天教大家如何Mint NFT在Opensea上显示出来。首先先写一个标准的ERC721合约。然后继承ERC721URIStorage。代码如下:// SPDX-License-Identifier: MITpragma solidity ^0.8.4;import "@openzeppelin/contracts/token/ERC721/ERC721.sol";import "@openzeppelin/contracts/token/ERC721/extensions/ERC721U原创 2022-03-01 11:26:17 · 2403 阅读 · 0 评论 -
Metaverse 元宇宙 Gamefi 链游 NFT盲盒
今天跟大家讲讲NFT盲盒的开发。首先写一个NFT合约,合约里我们可以自定义一些属性,例如:等级,种植,放牧,水产业,矿业等。然后继承NFT721协议,合约代码大致如下。调用safeMint就可以创建NFT了。第二个合约就是开盲盒的合约。源码如下。下面是我做的一个DemoFarm Lifehttp://106.52.21.244:8084/#/...原创 2022-02-25 10:07:25 · 9946 阅读 · 0 评论 -
DogeKing合约,分红DOGE,SHIB
现在我来分析一下这个DodeKing的源码。主要两个合约BABYTOKEN,BABYTOKENDividendTrackerBABYTOKEN我们来分析下它的构造函数 name_ 合约代币名称,symbol_合约代币符号,totalSupply_合约代币总量,addrs数组存放四个地址,地址1:要奖励的代币合约地址,地址2:swap路由,地址3:market钱包,地址4:分发分红合约地址,feeSettings数组存放3个参数,参数1:分红比,原创 2022-02-14 16:16:12 · 3247 阅读 · 18 评论 -
Bypass Contract Size Check
VulnerabilityIf an address is a contract then the size of code stored at the address will be greater than 0 right?Let's see how we can create a contract with code size returned byextcodesizeequal to 0.// SPDX-License-Identifier: MITpragma solidit..原创 2022-02-12 11:45:00 · 228 阅读 · 0 评论 -
Signature Replay
Signing messages off-chain and having a contract that requires that signature before executing a function is a useful technique.For example this technique is used to:reduce number of transaction on chain gas-less transaction, calledmeta transactionV.原创 2022-02-12 00:15:00 · 275 阅读 · 0 评论 -
Block Timestamp Manipulation
Vulnerabilityblock.timestampcan be manipulated by miners with the following constraintsit cannot be stamped with an earlier time than its parent it cannot be too far in the future// SPDX-License-Identifier: MITpragma solidity ^0.8.10;/*Roulette.原创 2022-02-11 20:15:00 · 431 阅读 · 0 评论 -
Front Running
VulnerabilityTransactions take some time before they are mined. An attacker can watch the transaction pool and send a transaction, have it included in a block before the original transaction. This mechanism can be abused to re-order transactions to the a原创 2022-02-11 10:15:00 · 277 阅读 · 0 评论 -
Honeypot
A honeypot is a trap to catch hackers.VulnerabilityCombining two exploits, reentrancy and hiding malicious code, we can build a contractthat will catch malicious users.// SPDX-License-Identifier: MITpragma solidity ^0.8.10;/*Bank is a contract原创 2022-02-11 16:45:00 · 199 阅读 · 0 评论 -
Phishing with tx.origin
What's the difference betweenmsg.senderandtx.origin?If contract A calls B, and B calls C, in Cmsg.senderis B andtx.originis A.VulnerabilityA malicious contract can deceive the owner of a contract into calling a function that only the owner sho...原创 2022-02-10 11:15:00 · 148 阅读 · 0 评论 -
Denial of Service
VulnerabilityThere are many ways to attack a smart contract to make it unusable.One exploit we introduce here is denial of service by making the function to send Ether fail.// SPDX-License-Identifier: MITpragma solidity ^0.8.10;/*The goal of Kin原创 2022-02-10 00:30:00 · 219 阅读 · 0 评论 -
Delegatecall
Vulnerabilitydelegatecallis tricky to use and wrong usage or incorrect understanding can lead to devastating results.You must keep 2 things in mind when usingdelegatecalldelegatecallpreserves context (storage, caller, etc...) storage layout must ...原创 2022-02-09 12:00:00 · 360 阅读 · 0 评论 -
Accessing Private Data
VulnerabilityAll data on a smart contract can be read.Let's see how we can readprivatedata. In the process you will learn how Solidity stores state variables.// SPDX-License-Identifier: MITpragma solidity ^0.8.10;/*Note: cannot use web3 on JVM..原创 2022-02-08 15:02:04 · 252 阅读 · 0 评论 -
Self Destruct
Contracts can be deleted from the blockchain by callingselfdestruct.selfdestructsends all remaining Ether stored in the contract to a designated address.VulnerabilityA malicious contract can useselfdestructto force sending Ether to any contract....原创 2022-02-09 10:00:00 · 388 阅读 · 1 评论 -
Arithmetic Overflow and Underflow
VulnerabilitySolidity < 0.8Integers in Solidity overflow / underflow without any errorsSolidity >= 0.8Default behaviour of Solidity 0.8 for overflow / underflow is to throw an error.// SPDX-License-Identifier: MITpragma solidity ^0.7.6;原创 2022-02-08 19:00:00 · 356 阅读 · 0 评论 -
Re-Entrancy
Hacks Re-Entrancy原创 2022-02-08 14:50:16 · 271 阅读 · 0 评论 -
MEME币|模式币智能合约|通缩机制合约|燃烧分红合约
特征1、分红SafeMoon 的第一个特点,是会惩罚尝试进行交易的人,并奖励给其他持有人。合约重写了 transfer 函数,使其在进行交易时会扣除一定手续费,用于惩罚交易发起人,源代码截图如下:翻译 2021-08-13 15:31:11 · 2358 阅读 · 5 评论 -
区块链+公链+区块浏览器+钱包APP
钱包APP先看截图区块浏览器浏览器地址http://120.53.106.253/#/EOS公链搭建一 .准备1. eosio账户公钥写死在代码中, 在代码根目录 CMakeList.txt里面,找到 EOSIO_ROOT_KEY,改为自己创建的公钥。并把新的密钥对 要在 config.ini文件中保存,见文件中 “signature-provider = 。。。”。 2.编译,安装,参加本人另一篇EOS编译文章...原创 2020-12-31 15:53:54 · 4741 阅读 · 1 评论 -
去中心化交易系统开发
准备Uniswap合约源码https://download.csdn.net/download/yanning1314/12890659核心合约周边合约前端代码在Uniswap的核心代码中,主要包含3个合约:工厂合约,配对合约,ERC20合约.其中配对合约继承了ERC20合约,我们可以把它们看作一个合约.工厂合约通过create2方法部署配对合约,所以在部署合约时只需要部署工厂合约.周边合约中包括一些示例代码,例如价格预言机,闪电交换,其中最重要的是路由合约.在周边合约的代码库中,包含两个路由合原创 2020-09-29 08:45:38 · 1819 阅读 · 1 评论