×
Array
(
[fid] => 6980
[description] =>
[password] =>
[icon] =>
[redirect] =>
[attachextensions] =>
[creditspolicy] => Array
(
[post] => Array
(
[usecustom] => 1
[cycletype] => 1
[cycletime] => 0
[rewardnum] => 75
[extcredits1] => 0
[extcredits2] => 0
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 1
[fid] => 6980
[rulename] => 发表主题
[action] => post
[fids] => 32,52,67,447,1120,1151,1156,6750,6762,6763,6766,6769,6772,6773,6787,6796,6808,6809,6810,6813,6814,6820,6829,6830,6846,6856,6864,6865,6827,6930,6931,6776,6858,6880,6764,6932,6871,6758,6905,1116,6788,6812,6798,6736,6759,6842,6966,6767,6828,6924,6935,6936,6938,6940,6941,6826,6909,6803,6919,6911,6908,6881,6920,6912,6913,6921,6925,6922,6789,6818,6819,6872,6928,6969,6889,6888,6917,6939,6947,6961,6937,6943,6970,6869,6900,6902,6783,6817,1111,6870,6821,6951,6876,6952,6954,6960,6942,6910,6949,6962,6963,6964,6927,6926,6973,6728,6929,6874,6894,6896,6885,6857,6868,1113,6778,56,6844,6878,6802,6933,6811,6923,6877,6875,6918,6892,6757,6832,6833,6795,6793,6848,6837,6849,6850,6851,6852,6853,6854,6863,6882,6836,6790,6838,6794,6791,6873,555,6895,6934,6958,6944,6945,6907,6779,6886,6950,6904,6956,6862,6957,6855,6955,6959,6914,6965,6971,6972,6953,6975,6976,6799,6974,6824,6815,6891,6866,6979,6977,6765,6903,6948,6845,6879,1121,6980
)
[reply] => Array
(
[usecustom] => 1
[cycletype] => 4
[cycletime] => 0
[rewardnum] => 0
[extcredits1] => 0
[extcredits2] => 0
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 2
[fid] => 6980
[rulename] => 发表回复
[action] => reply
)
[digest] => Array
(
[usecustom] => 1
[cycletype] => 4
[cycletime] => 0
[rewardnum] => 0
[extcredits1] => 0
[extcredits2] => 0
[extcredits3] => 0
[extcredits4] => 0
[extcredits5] => 0
[extcredits6] => 0
[extcredits7] => 0
[extcredits8] => 0
[rid] => 3
[fid] => 6980
[rulename] => 加精华
[action] => digest
)
)
[formulaperm] => a:5:{i:0;s:0:"";i:1;s:0:"";s:7:"message";s:0:"";s:5:"medal";N;s:5:"users";s:0:"";}
[moderators] =>
[rules] =>
[threadtypes] => Array
(
[status] => 1
[required] => 0
[listable] => 0
[types] => Array
(
)
)
[threadsorts] => Array
(
)
[viewperm] =>
[postperm] =>
[replyperm] =>
[getattachperm] =>
[postattachperm] =>
[postimageperm] =>
[spviewperm] =>
[seotitle] =>
[keywords] =>
[seodescription] =>
[supe_pushsetting] =>
[modrecommend] => Array
(
[open] => 0
[num] => 10
[imagenum] => 0
[imagewidth] => 300
[imageheight] => 250
[maxlength] => 0
[cachelife] => 0
[dateline] => 0
)
[threadplugin] => Array
(
)
[replybg] =>
[extra] => a:2:{s:9:"namecolor";s:0:"";s:9:"iconwidth";s:0:"";}
[jointype] => 0
[gviewperm] => 0
[membernum] => 0
[dateline] => 0
[lastupdate] => 0
[activity] => 0
[founderuid] => 0
[foundername] =>
[banner] =>
[groupnum] => 0
[commentitem] =>
[relatedgroup] =>
[picstyle] => 0
[widthauto] => 0
[noantitheft] => 0
[noforumhidewater] => 0
[noforumrecommend] => 0
[livetid] => 0
[price] => 0
[fup] => 6974
[type] => sub
[name] => 币圈资讯
[status] => 1
[displayorder] => 0
[styleid] => 0
[threads] => 51596
[posts] => 51664
[todayposts] => 0
[yesterdayposts] => 0
[rank] => 61
[oldrank] => 61
[lastpost] => 2691052 Bitwise CIO:比特币的“成熟价位”是 50 万美元 1731502020 比推快讯
[domain] =>
[allowsmilies] => 1
[allowhtml] => 1
[allowbbcode] => 1
[allowimgcode] => 1
[allowmediacode] => 0
[allowanonymous] => 0
[allowpostspecial] => 1
[allowspecialonly] => 0
[allowappend] => 0
[alloweditrules] => 0
[allowfeed] => 0
[allowside] => 0
[recyclebin] => 1
[modnewposts] => 0
[jammer] => 0
[disablewatermark] => 0
[inheritedmod] => 0
[autoclose] => 0
[forumcolumns] => 0
[catforumcolumns] => 0
[threadcaches] => 0
[alloweditpost] => 1
[simple] => 16
[modworks] => 0
[allowglobalstick] => 1
[level] => 0
[commoncredits] => 0
[archive] => 0
[recommend] => 0
[favtimes] => 0
[sharetimes] => 0
[disablethumb] => 0
[disablecollect] => 0
[ismoderator] => 0
[threadtableid] => 0
[allowreply] =>
[allowpost] =>
[allowpostattach] =>
)
[合约解读]CryptoPunk 世界上最早的去中心化NFT交易市场
[复制链接]
|
当前离线
经验:
天策币:
活跃币:
策小分:
总在线: 分钟
本月在线: 分钟
|
|
CryptoPunk 加密朋克不仅是一个顶级蓝筹NFT项目 (地板价为70ETH约15W刀),更是后续ERC721标准协议的灵感来源。
NFT交易市场,是目前整个区块链行业中除了以太坊本身之外最高收入的赛道,而OpenSea,x2y2,LooksRare 是目前Top3平台,其合计交易量占99%以上。
今天咱们将解读CryptoPunk的区区230行源码,其对订单模型与交易流程的实现,探索其内置的专用NFT交易市场的优势缺点,也为后续逐步源码分析3大NFT交易市场合约模型做基础铺垫。
想知道大蛋糕未来鹿死谁手,不妨和我一起源码入手吧。
CryptoPunk内置的交易市场
如果细心的同学可以发现,在OpenSea上如果想购买Punk在其属性页面会发现,对其所用标准的描述并非ERC721或者1155,而是绝无仅有的cryptoPunks,他作为2017年推出堪称史上最早的NFT协议(成为后续以太坊基金会推出的721标准的灵感来源),不仅实现了如今721标准的多数功能甚至还在其中内置了一个完全去中心化的交易服务市场,实现3种交易拍卖模式!
拓展阅读:【源码解读】你买的NFT到底是什么?
其实对于NFT最底层而言,交易流动是个最最基础的功能了,无非是要求双方都使用tansfer,卖方给买方NFT,买方给卖方ETH,一手交钱一手交货,但是当面交易尚且担忧对方不给钱呢。因此原子性,是达成信任的必备因素,链上成交基于不可更改的特性正是最佳解决方案
1、Punk优美的订单模型
回想一下,咱们在现实中是如何买卖商品的,大概有三类
卖家报价,买家支付→等于超市选购 买家报价,卖家同意→等于菜市口砍价 线下议价,链上成交→等于线下公证拍卖
无论哪种,最终达成成交则需要执行交换,既要防止卖家不给货,也要防止买家不给钱。
区块链技术虽然完美的解决了万一不给钱的问题,但是也带来了议价困难的痛点,毕竟“砍一刀价格”都是要上链的,肯定不能用拼多多那样的砍小数点后6位(- 。-)
Punk的market同时支持这3大类交易形式,既可以卖家报价,也可以买家报价,也可以议价后由合约帮你成交,全程无任何版税扣取,且230行简短的代码也杜绝了后门的可能
他的订单结构非常简单分两种:卖家报价单Offer和买家投标单Bid
1.1、卖家报价单Offer
与标准NFT一样,每个Punk都有一个唯一ID,因此每个punk都有一个独占的Offer订单簿,这个独占指的是,如果我重新报价无论是涨价还是降价,都将会替换掉前一个
这里通过isForSale |
|
|
|
|
|
|