![](https://cdn.steemitimages.com/DQmakk2m9j4ztuhFaWn7isYUbtNt2FAuL7KznQwUpm9NiAQ/image.png) # # # > **steemit上的Escrow Transfer过了有效期居然不会自动付款。** 被娃吵醒了,睡不着,干脆起了个早。 想起昨天@davidke20 让看一下escrow,遂研究了一番。 研究后发现,steemit实现的escrow有点奇怪。 # 一共有四个Escrow操作,分别是 escrow_transfer escrow_approve escrow_release escrow_dispute 官方文档看这里:https://developers.steem.io/apidefinitions/#broadcast_ops_escrow_transfer ### 1.escrow_transfer ```javascript steem.broadcast.escrowTransfer( wif, // active key from, to, agent, escrow_id, sbd_amount, steem_amount, fee, ratification_deadline, escrow_expiration, JSON.stringify({'test':'test'}), function(err, response) { console.log(err, response); } ); ``` 这些字段字面理解即可,我就不做过多说明了。 执行后会产生这样一条交易记录。 ![](https://cdn.steemitimages.com/DQmY7KBx3tsXn7YzRWfhaRCMQDsCuWuH5h8XX9nCSWqLo32/image.png) ### 2.escrow_approve ```javascript steem.broadcast.escrowApprove( wif, from, to, agent, who, escrow_id, 'true', function(err, response) { console.log(err, response); } ); ``` 产生区块记录如下: ![](https://cdn.steemitimages.com/DQmdudzAn34qd8CsTj2ZZocP7R8Qd2yhV4QvZem4qtjnm6b/image.png) 交易发起后,需要收款方和escrow代理各自执行approve操作。然后,escrow交易才算正式开始。 如果收款方和代理没有在ratification_deadline规定的时间内approve。发起方被暂扣的款项将退回发起方帐号。 ### 3.escrow_release ```javascript steem.broadcast.escrowRelease( wif, from, to, agent, who, receiver, escrow_id, sbd_balance, steem_balance, function(err, response) { console.log(err, response); } ); ``` ![](https://cdn.steemitimages.com/DQmcWbw9Crh1tFdzEvwXce8THZaBv9qJjiPiLD2xafzMLha/image.png) 这个是用来付款的。官方规则如下: **如果没有纠纷**,没人调用escrow_dispute方法: 那么分为有效期内和过期两种情况。 有效期内,付款和收款方可以分**多次**分批支付或退回款项给对方。 过有效期后,“诡异”的事情出现了。付款和收款方可以任意支配escrow交易里的余额了,可以付给对方,也可以付给自己。**到期后,难道款项不是应该自动付给收款方的吗?** 这样的话,这个方法似乎就只适合大宗贸易而不太适合普通电商支付了。 (另外,没有纠纷的情况下,escrow代理是无权执行此方法的。) **如果有纠纷**,那么就只能由escrow代理来执行该方法了。 ### 4.escrow_dispute 由于其他方法测试一切正常,这个方法我就没测了。这个是发起纠纷仲裁的。付款和收款方可以调用该方法让escrow代理来仲裁。这样付款权限就交到escrow代理手里了。 经测试,escrow交易正常可用。只是到期不会自动给把款项付给收款方,这个有点诡异。不太适合收款方有大量交易的应用场景。
post_id | 65,932,748 |
---|---|
author | liuzhixiang |
permlink | steemit-escrow-transfer |
category | cn |
json_metadata | {"app":"steemit\/0.1","links":["https:\/\/developers.steem.io\/apidefinitions\/#broadcast_ops_escrow_transfer"],"format":"markdown","tags":["cn","steemit","steem","blog","dev"],"users":["davidke20"],"image":["https:\/\/cdn.steemitimages.com\/DQmakk2m9j4ztuhFaWn7isYUbtNt2FAuL7KznQwUpm9NiAQ\/image.png"]} |
created | 2018-11-12 22:30:15 |
last_update | 2018-11-12 22:49:21 |
depth | 0 |
children | 3 |
net_rshares | 69,154,635,169 |
last_payout | 2018-11-19 22:30:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.044 SBD |
curator_payout_value | 0.006 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 2,212 |
author_reputation | 1,281,674,600,435 |
root_title | "steemit上的Escrow Transfer怎么这么奇怪?" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
eforucom | 0 | 3,761,011,986 | 1.13% | ||
wilhb81 | 0 | 2,348,490,744 | 5% | ||
den9 | 0 | 479,893,719 | 100% | ||
amaratonna | 0 | 479,636,166 | 100% | ||
ismaelahr | 0 | 478,818,194 | 100% | ||
hranushdavdyan | 0 | 479,067,839 | 100% | ||
nevisajar | 0 | 478,990,698 | 100% | ||
sigur | 0 | 478,342,541 | 100% | ||
beamarete | 0 | 478,051,974 | 100% | ||
berwynelbow | 0 | 478,912,404 | 100% | ||
soapmousse | 0 | 478,738,285 | 100% | ||
mailrabbit | 0 | 479,235,639 | 100% | ||
sunai | 0 | 485,827,196 | 15% | ||
nikolay.suhoruk | 0 | 479,755,179 | 100% | ||
crispysuperb | 0 | 479,002,965 | 100% | ||
bibslivered | 0 | 478,972,037 | 100% | ||
serinpunctured | 0 | 479,590,581 | 100% | ||
mothersmerlin | 0 | 479,120,285 | 100% | ||
grossoexercise | 0 | 479,751,189 | 100% | ||
eatercaper | 0 | 479,848,314 | 100% | ||
couldpinkie | 0 | 480,201,537 | 100% | ||
grouseunhelpful | 0 | 479,541,532 | 100% | ||
rootscheese | 0 | 479,988,974 | 100% | ||
zy-sb | 0 | 623,160,914 | 100% | ||
svlasov1984 | 0 | 481,067,840 | 100% | ||
steemexpress | 0 | 48,007,231,191 | 100% | ||
glotstoke | 0 | 482,573,487 | 100% | ||
cheesylawn | 0 | 483,130,069 | 100% | ||
anschat1984 | 0 | 482,883,268 | 100% | ||
eduardkasy | 0 | 483,236,059 | 100% | ||
prefsilleoconch | 0 | 482,468,778 | 100% | ||
colloquialitchy | 0 | 482,359,606 | 100% | ||
godwitresources | 0 | 482,852,757 | 100% | ||
socksroute | 0 | 482,881,222 | 100% |
那你后来收到了吗? Posted using [Partiko Android](https://steemit.com/@partiko-android)
post_id | 65,932,889 |
---|---|
author | davidke20 |
permlink | davidke20-re-liuzhixiang-steemit-escrow-transfer-20181112t223443278z |
category | cn |
json_metadata | {"app":"partiko"} |
created | 2018-11-12 22:34:42 |
last_update | 2018-11-12 22:34:42 |
depth | 1 |
children | 1 |
net_rshares | 0 |
last_payout | 2018-11-19 22:34:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 79 |
author_reputation | 317,850,004,724,810 |
root_title | "steemit上的Escrow Transfer怎么这么奇怪?" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
post_id | 65,932,932 |
---|---|
author | liuzhixiang |
permlink | re-davidke20-davidke20-re-liuzhixiang-steemit-escrow-transfer-20181112t223555908z |
category | cn |
json_metadata | {"app":"steemit\/0.1","tags":["cn"]} |
created | 2018-11-12 22:35:54 |
last_update | 2018-11-12 22:35:54 |
depth | 2 |
children | 0 |
net_rshares | 28,735,094,890 |
last_payout | 2018-11-19 22:35:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.018 SBD |
curator_payout_value | 0.005 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 10 |
author_reputation | 1,281,674,600,435 |
root_title | "steemit上的Escrow Transfer怎么这么奇怪?" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
davidke20 | 0 | 9,631,412,632 | 50% | ||
dustbunny | 0 | 19,103,682,258 | 7.62% |
还真是怪 Posted using [Partiko Android](https://steemit.com/@partiko-android)
post_id | 65,935,484 |
---|---|
author | wilhb81 |
permlink | wilhb81-re-liuzhixiang-steemit-escrow-transfer-20181112t234852467z |
category | cn |
json_metadata | {"app":"partiko"} |
created | 2018-11-12 23:48:51 |
last_update | 2018-11-12 23:48:51 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-11-19 23:48:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 74 |
author_reputation | 458,259,114,007,420 |
root_title | "steemit上的Escrow Transfer怎么这么奇怪?" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |