Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
f42114ca
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f42114ca
编写于
7月 24, 2019
作者:
W
Wang Zhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
N/A
上级
58243806
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
834 addition
and
183 deletion
+834
-183
bp_number
bp_number
+126
-0
contracts/eosio.system/eosio.system.hpp
contracts/eosio.system/eosio.system.hpp
+11
-1
contracts/eosio.system_bak/delegate_bandwidth.cpp
contracts/eosio.system_bak/delegate_bandwidth.cpp
+0
-24
contracts/eosio.system_bak/eosio.system.abi
contracts/eosio.system_bak/eosio.system.abi
+4
-8
contracts/eosio.system_bak/eosio.system.cpp
contracts/eosio.system_bak/eosio.system.cpp
+0
-1
contracts/eosio.system_bak/eosio.system.hpp
contracts/eosio.system_bak/eosio.system.hpp
+31
-30
contracts/eosio.system_bak/voting.cpp
contracts/eosio.system_bak/voting.cpp
+42
-119
contracts/hdddeposit/hdddeposit.cpp
contracts/hdddeposit/hdddeposit.cpp
+1
-0
yta_boot.sh
yta_boot.sh
+104
-0
yttboot.txt
yttboot.txt
+515
-0
未找到文件。
bp_number
0 → 100644
浏览文件 @
f42114ca
星际特工
bitcodeman13
YTA5sehnu5GMKXHiu8USGs8o5rZ3zdKQZbvLjs2XBcbSS1DvW9siq
http://35.176.59.89:8888
四川微存
scwcwl555555
YTA8TYpYvTovitMXGFZpUSBkaTig4o5doCHHm3ChfvT4BPZvEpwsa
http://129.28.188.167:8888
北京工信融创云
bjgxyjd33333
YTA7qKSL9oo5PqExUpL7QH1xyfcMQ4FwXq259DBwafKNGbTiPEA6G
http://139.155.106.14:8888
中创思维
zhongchuang1
YTA6VuFCGz3Z3gUoGqdB7KzA1sqRDiYY3Ywfq4EdUTsByKSfVxw39
http://47.91.114.170:8888
星际链盟
xjlmkc121315
YTA5ocg4uUNW8CQEwe2ocKc6e656z6TsvQWrLZuZH88TXTvBTxo4P
http://49.51.205.149:8888
------------------------------------------
上海鑫兜科技
shxindoukj11
YTA69Jwu2gj3kc8fRuMhRYDJuPn31kjSmTpz9qYHt5rLrjNrYbwf5
http://106.15.235.83:8888
梅得斯帕
fengjun23111
YTA652Ze5eLvMvpEyXd14K9FAAHKDnizkKJnFKf7ipQhqbXtDV1Pr
http://118.190.38.93:8888
五维星链
wwxl12312312
YTA4xeQLbprgY4Y9YRTcTmYyX1kTkC5nEg6RPvGPXNYzFEFbxYLCJ
http://147.139.132.150:8888
泛圈网络
fanquankeji1
YTA7ndNYZg8KR7NKjgYUQ8Y7HocDP6xUq1gdHNtmQEyPoMNWnKUGA
http://129.28.191.41:8888
颐汇科技
cdyihui11111
YTA6BnW2RcWgz2qAfAsUQFiGhMEA7W5BaYb5qpFP4tMnjHXtW3NbA
http://3.213.101.41:8888
浙江千腾网络
qianteng1111
YTA59jzThVMCPWP1syroVCRNcGk4BBoKtN7cZbWQLtSdPsfhwPGJP
http://47.112.150.170:8888
庄红伟(洛阳殊缘)洛阳燊一科技
shuyuan11111
YTA7Qvxca8YnQhzw658yDS4c6ew58Dh37xnAWS2HBDVEoT4L6sWby
http://47.97.217.154:8888
------------------------------------------------------------------------------------------------------------------------------------------------
智网科技
zhiwangsun11
YTA5duxptENmJf9joBYQsv8W1DMkKbwaef82XQA6qUznH4CwKP9C8
http://120.92.140.173:8888
松尼科技
cc2cc3cc4cc5
YTA7MhtxwzNuUNmyjCLmuFF79DAsEaYAuy6cbkgecScjgkb26qwSL
http://13.235.5.108:8888
中文社区
zhongwen1111
YTA5u1Q4MSCc5abbuDagYLCzQW9ZC4potUM8cr2MSEkT9rdb3YP57
http://152.136.14.175:8888
广西东林
wzdgxdl12345
YTA74BXt2rajTaV5HJfw4axHf5wZ9EYroCSVUDUmQVjYLADE9KNf6
http://18.200.4.165:8888
云尺科技
yunchikj1313
YTA5Vxbyob3irNLJrAixitpsRyYbCEjWNVZfJCE63NPruX6DmMXYS
http://3.13.161.16:8888
河南隽德(开封)
jundekeji123
YTA8GjmXJ65DaUf7zDiGS63KPd4cWHKctV1c3LP9MTD6vbDTAouZR
http://39.104.201.48:8888
星通科技
xingtong1111
YTA6Cko5uoJfDFkqo6jbw1iF4VU1TnW5V4pzwNLXRkzFiQps3unvG
http://47.112.138.94:8888
润聘科技
runpinkeji11
YTA6MnBMNh6SQpdq6Nh4e2WEKrmCLXicC9DcKTjAqkpaD5Mr9GHXP
http://52.60.157.92:8888
星帮客社区
xingbangke11
YTA8SvK6ggv8WKGm8KrGEL6JTMGVxqjH7pHQbtk9puSh2iVhHs69i
http://62.234.163.238:8888
contracts/eosio.system/eosio.system.hpp
浏览文件 @
f42114ca
...
...
@@ -169,7 +169,7 @@ namespace eosiosystem {
std
::
vector
<
account_name
>
producers
;
/// the producers approved by this voter if no proxy set
int64_t
staked
=
0
;
/**
/**
* Every time a vote is cast we must first "undo" the last vote weight, before casting the
* new vote weight. Vote weight is calculated as:
*
...
...
@@ -357,4 +357,14 @@ namespace eosiosystem {
void
propagate_weight_change
(
const
voter_info
&
voter
);
};
uint16_t
getProducerSeq
(
account_name
producer
){
producers_ext_table
_producer_ext
(
N
(
eosio
),
N
(
eosio
));
auto
prod
=
_producer_ext
.
find
(
producer
);
if
(
prod
!=
_producer_ext
.
end
())
{
return
prod
->
seq_num
;
}
return
0
;
}
}
/// eosiosystem
contracts/eosio.system_bak/delegate_bandwidth.cpp
浏览文件 @
f42114ca
...
...
@@ -354,30 +354,6 @@ namespace eosiosystem {
{
source_stake_from
,
N
(
eosio
.
stake
),
asset
(
transfer_amount
),
std
::
string
(
"stake bandwidth"
)
}
);
}
}
// update voting power
{
asset
total_update
=
stake_net_delta
+
stake_cpu_delta
;
auto
from_voter
=
_voters
.
find
(
from
);
if
(
from_voter
==
_voters
.
end
()
)
{
from_voter
=
_voters
.
emplace
(
from
,
[
&
](
auto
&
v
)
{
v
.
owner
=
from
;
v
.
staked
=
total_update
.
amount
;
});
}
else
{
_voters
.
modify
(
from_voter
,
0
,
[
&
](
auto
&
v
)
{
v
.
staked
+=
total_update
.
amount
;
});
}
eosio_assert
(
0
<=
from_voter
->
staked
,
"stake for voting cannot be negative"
);
if
(
from
==
N
(
b1
)
)
{
validate_b1_vesting
(
from_voter
->
staked
);
}
if
(
from_voter
->
producers
.
size
()
||
from_voter
->
proxy
)
{
update_votes
(
from
,
from_voter
->
proxy
,
from_voter
->
producers
,
false
);
}
}
}
void
system_contract
::
delegatebw
(
account_name
from
,
account_name
receiver
,
...
...
contracts/eosio.system_bak/eosio.system.abi
浏览文件 @
f42114ca
...
...
@@ -381,16 +381,12 @@
{"name":"producers", "type":"account_name[]"}
]
},{
"name": "voter_info",
"name": "
yta_
voter_info",
"base": "",
"fields": [
{"name":"owner", "type":"account_name"},
{"name":"proxy", "type":"account_name"},
{"name":"producers", "type":"account_name[]"},
{"name":"staked", "type":"int64"},
{"name":"last_vote_weight", "type":"float64"},
{"name":"proxied_vote_weight", "type":"float64"},
{"name":"is_proxy", "type":"bool"}
{"name":"last_vote_weight", "type":"int64"}
]
},{
"name": "claimrewards",
...
...
@@ -655,8 +651,8 @@
"key_names" : [],
"key_types" : []
},{
"name": "voters",
"type": "voter_info",
"name": "
yta
voters",
"type": "
yta_
voter_info",
"index_type": "i64",
"key_names" : ["owner"],
"key_types" : ["account_name"]
...
...
contracts/eosio.system_bak/eosio.system.cpp
浏览文件 @
f42114ca
...
...
@@ -11,7 +11,6 @@ namespace eosiosystem {
system_contract
::
system_contract
(
account_name
s
)
:
native
(
s
),
_voters
(
_self
,
_self
),
_producers
(
_self
,
_self
),
_global
(
_self
,
_self
),
_rammarket
(
_self
,
_self
),
...
...
contracts/eosio.system_bak/eosio.system.hpp
浏览文件 @
f42114ca
...
...
@@ -161,40 +161,19 @@ namespace eosiosystem {
};
typedef
eosio
::
singleton
<
N
(
all_prods
),
all_prods_level
>
all_prods_singleton
;
//##YTA-Change end:
struct
voter_info
{
struct
yta_voter_info
{
account_name
owner
=
0
;
/// the voter
account_name
proxy
=
0
;
/// the proxy set by the voter, if any
std
::
vector
<
account_name
>
producers
;
/// the producers approved by this voter if no proxy set
int64_t
staked
=
0
;
/**
* Every time a vote is cast we must first "undo" the last vote weight, before casting the
* new vote weight. Vote weight is calculated as:
*
* stated.amount * 2 ^ ( weeks_since_launch/weeks_per_year)
*/
double
last_vote_weight
=
0
;
/// the vote weight cast the last time the vote was updated
/**
* Total vote weight delegated to this voter.
*/
double
proxied_vote_weight
=
0
;
/// the total vote weight delegated to this voter as a proxy
bool
is_proxy
=
0
;
/// whether the voter is a proxy for others
uint32_t
reserved1
=
0
;
time
reserved2
=
0
;
eosio
::
asset
reserved3
;
int64_t
last_vote_weight
=
0
;
uint64_t
primary_key
()
const
{
return
owner
;
}
// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE
(
voter_info
,
(
owner
)(
proxy
)(
producers
)(
staked
)(
last_vote_weight
)(
proxied_vote_weight
)(
is_proxy
)(
reserved1
)(
reserved2
)(
reserved3
)
)
EOSLIB_SERIALIZE
(
yta_voter_info
,
(
owner
)(
producers
)(
last_vote_weight
)
)
};
typedef
eosio
::
multi_index
<
N
(
voters
),
voter_info
>
voters_table
;
typedef
eosio
::
multi_index
<
N
(
ytavoters
),
yta_voter_info
>
ytavoters_table
;
//##YTA-Change end:
typedef
eosio
::
multi_index
<
N
(
producers
),
producer_info
,
...
...
@@ -219,7 +198,6 @@ namespace eosiosystem {
class
system_contract
:
public
native
{
private:
voters_table
_voters
;
producers_table
_producers
;
global_state_singleton
_global
;
eosio_global_state
_gstate
;
...
...
@@ -353,8 +331,31 @@ namespace eosiosystem {
void
update_votes
(
const
account_name
voter
,
const
account_name
proxy
,
const
std
::
vector
<
account_name
>&
producers
,
bool
voting
);
// defined in voting.cpp
void
propagate_weight_change
(
const
voter_info
&
voter
);
};
uint16_t
getProducerSeq
(
account_name
producer
){
producers_ext_table
_producer_ext
(
N
(
eosio
),
N
(
eosio
));
auto
prod
=
_producer_ext
.
find
(
producer
);
if
(
prod
!=
_producer_ext
.
end
())
{
return
prod
->
seq_num
;
}
return
0
;
}
bool
is_yta_voter
(
account_name
from
,
account_name
to
)
{
ytavoters_table
_voters
(
N
(
eosio
),
N
(
eosio
));
auto
voter
=
_voters
.
find
(
from
);
if
(
voter
!=
_voters
.
end
()
)
{
return
true
;
}
auto
voter2
=
_voters
.
find
(
from
);
if
(
voter2
!=
_voters
.
end
()
)
{
return
true
;
}
return
false
;
}
}
/// eosiosystem
contracts/eosio.system_bak/voting.cpp
浏览文件 @
f42114ca
...
...
@@ -18,6 +18,9 @@
#include <algorithm>
#include <cmath>
#define UNUSED(expr) do { (void)(expr); } while (0)
namespace
eosiosystem
{
using
eosio
::
indexed_by
;
using
eosio
::
const_mem_fun
;
...
...
@@ -823,11 +826,9 @@ namespace eosiosystem {
}
void
system_contract
::
update_votes
(
const
account_name
voter_name
,
const
account_name
proxy
,
const
std
::
vector
<
account_name
>&
producers
,
bool
voting
)
{
//validate input
if
(
proxy
)
{
eosio_assert
(
producers
.
size
()
==
0
,
"cannot vote for producers and proxy at same time"
);
eosio_assert
(
voter_name
!=
proxy
,
"cannot proxy to self"
);
require_recipient
(
proxy
);
eosio_assert
(
1
==
2
,
"not supported"
);
}
else
{
//##YTA-Change start:
//eosio_assert( producers.size() <= 30, "attempt to vote for too many producers" );
...
...
@@ -839,99 +840,65 @@ namespace eosiosystem {
}
}
auto
voter
=
_voters
.
find
(
voter_name
);
eosio_assert
(
voter
!=
_voters
.
end
(),
"user must stake before they can vote"
);
/// staking creates voter object
eosio_assert
(
!
proxy
||
!
voter
->
is_proxy
,
"account registered as a proxy is not allowed to use a proxy"
);
/**
* The first time someone votes we calculate and set last_vote_weight, since they cannot unstake until
* after total_activated_stake hits threshold, we can use last_vote_weight to determine that this is
* their first vote and should consider their stake activated.
*/
if
(
voter
->
last_vote_weight
<=
0.0
)
{
_gstate
.
total_activated_stake
+=
voter
->
staked
;
if
(
_gstate
.
total_activated_stake
>=
min_activated_stake
&&
_gstate
.
thresh_activated_stake_time
==
0
)
{
_gstate
.
thresh_activated_stake_time
=
current_time
();
}
}
ytavoters_table
_voters
(
_self
,
_self
);
auto
new_vote_weight
=
stake2vote
(
voter
->
staked
);
if
(
voter
->
is_proxy
)
{
new_vote_weight
+=
voter
->
proxied_vote_weight
;
}
auto
voter
=
_voters
.
find
(
voter_name
);
if
(
voter
==
_voters
.
end
()
)
{
voter
=
_voters
.
emplace
(
voter_name
,
[
&
](
auto
&
v
)
{
v
.
owner
=
voter_name
;
});
}
boost
::
container
::
flat_map
<
account_name
,
pair
<
double
,
bool
/*new*/
>
>
producer_deltas
;
if
(
voter
->
last_vote_weight
>
0
)
{
if
(
voter
->
proxy
)
{
auto
old_proxy
=
_voters
.
find
(
voter
->
proxy
);
eosio_assert
(
old_proxy
!=
_voters
.
end
(),
"old proxy not found"
);
//data corruption
_voters
.
modify
(
old_proxy
,
0
,
[
&
](
auto
&
vp
)
{
vp
.
proxied_vote_weight
-=
voter
->
last_vote_weight
;
});
propagate_weight_change
(
*
old_proxy
);
}
else
{
for
(
const
auto
&
p
:
voter
->
producers
)
{
auto
&
d
=
producer_deltas
[
p
];
d
.
first
-=
voter
->
last_vote_weight
;
d
.
second
=
false
;
}
for
(
const
auto
&
pd
:
voter
->
producers
)
{
double
total_votes
=
0
;
auto
pitr
=
_producers
.
find
(
pd
);
if
(
pitr
!=
_producers
.
end
()
)
{
_producers
.
modify
(
pitr
,
0
,
[
&
](
auto
&
p
)
{
p
.
total_votes
-=
voter
->
last_vote_weight
;
if
(
p
.
total_votes
<
0
)
{
// floating point arithmetics can give small negative numbers
p
.
total_votes
=
0
;
}
_gstate
.
total_producer_vote_weight
-=
voter
->
last_vote_weight
;
total_votes
=
p
.
total_votes
;
});
}
auto
pitr2
=
_producersext
.
find
(
pd
);
if
(
pitr2
!=
_producersext
.
end
()
)
{
//pitr2->seq_num
update_producers_seq_totalvotes
(
pitr2
->
seq_num
,
pd
,
total_votes
);
}
}
if
(
proxy
)
{
auto
new_proxy
=
_voters
.
find
(
proxy
);
eosio_assert
(
new_proxy
!=
_voters
.
end
(),
"invalid proxy specified"
);
//if ( !voting ) { data corruption } else { wrong vote }
eosio_assert
(
!
voting
||
new_proxy
->
is_proxy
,
"proxy not found"
);
if
(
new_vote_weight
>=
0
)
{
_voters
.
modify
(
new_proxy
,
0
,
[
&
](
auto
&
vp
)
{
vp
.
proxied_vote_weight
+=
new_vote_weight
;
});
propagate_weight_change
(
*
new_proxy
);
}
}
else
{
if
(
new_vote_weight
>=
0
)
{
for
(
const
auto
&
p
:
producers
)
{
auto
&
d
=
producer_deltas
[
p
];
d
.
first
+=
new_vote_weight
;
d
.
second
=
true
;
}
}
}
auto
new_vote_weight
=
eosio
::
token
(
N
(
eosio
.
token
)).
get_balance
(
voter_name
,
CORE_SYMBOL
).
amount
;
for
(
const
auto
&
pd
:
producer_deltas
)
{
for
(
const
auto
&
pd
:
voter
->
producers
)
{
double
total_votes
=
0
;
auto
pitr
=
_producers
.
find
(
pd
.
first
);
auto
pitr
=
_producers
.
find
(
pd
);
if
(
pitr
!=
_producers
.
end
()
)
{
eosio_assert
(
!
voting
||
pitr
->
active
()
||
!
pd
.
second
.
second
/* not from new set */
,
"producer is not currently registered"
);
_producers
.
modify
(
pitr
,
0
,
[
&
](
auto
&
p
)
{
p
.
total_votes
+=
pd
.
second
.
firs
t
;
p
.
total_votes
+=
new_vote_weigh
t
;
if
(
p
.
total_votes
<
0
)
{
// floating point arithmetics can give small negative numbers
p
.
total_votes
=
0
;
}
_gstate
.
total_producer_vote_weight
+=
pd
.
second
.
first
;
//eosio_assert( p.total_votes >= 0, "something bad happened" );
_gstate
.
total_producer_vote_weight
+=
new_vote_weight
;
total_votes
=
p
.
total_votes
;
});
}
else
{
eosio_assert
(
!
pd
.
second
.
second
/* not from new set */
,
"producer is not registered"
);
//data corruption
eosio_assert
(
1
==
1
,
"producer is not registered"
);
}
//##YTA-Change start:
auto
pitr2
=
_producersext
.
find
(
pd
.
first
);
auto
pitr2
=
_producersext
.
find
(
pd
);
if
(
pitr2
!=
_producersext
.
end
()
)
{
//pitr2->seq_num
update_producers_seq_totalvotes
(
pitr2
->
seq_num
,
pd
.
first
,
total_votes
);
}
else
{
eosio_assert
(
!
pd
.
second
.
second
/* not from new set */
,
"producer is not registered"
);
//data corruption
update_producers_seq_totalvotes
(
pitr2
->
seq_num
,
pd
,
total_votes
);
}
else
{
eosio_assert
(
1
==
1
,
"producer is not registered"
);
}
//##YTA-Change end:
}
_voters
.
modify
(
voter
,
0
,
[
&
](
auto
&
av
)
{
av
.
last_vote_weight
=
new_vote_weight
;
av
.
producers
=
producers
;
av
.
proxy
=
proxy
;
});
}
...
...
@@ -945,55 +912,11 @@ namespace eosiosystem {
* @pre new state must be different than current state
*/
void
system_contract
::
regproxy
(
const
account_name
proxy
,
bool
isproxy
)
{
eosio_assert
(
1
==
2
,
"not supported"
);
require_auth
(
proxy
);
auto
pitr
=
_voters
.
find
(
proxy
);
if
(
pitr
!=
_voters
.
end
()
)
{
eosio_assert
(
isproxy
!=
pitr
->
is_proxy
,
"action has no effect"
);
eosio_assert
(
!
isproxy
||
!
pitr
->
proxy
,
"account that uses a proxy is not allowed to become a proxy"
);
_voters
.
modify
(
pitr
,
0
,
[
&
](
auto
&
p
)
{
p
.
is_proxy
=
isproxy
;
});
propagate_weight_change
(
*
pitr
);
}
else
{
_voters
.
emplace
(
proxy
,
[
&
](
auto
&
p
)
{
p
.
owner
=
proxy
;
p
.
is_proxy
=
isproxy
;
});
}
}
UNUSED
(
isproxy
);
void
system_contract
::
propagate_weight_change
(
const
voter_info
&
voter
)
{
eosio_assert
(
voter
.
proxy
==
0
||
!
voter
.
is_proxy
,
"account registered as a proxy is not allowed to use a proxy"
);
double
new_weight
=
stake2vote
(
voter
.
staked
);
if
(
voter
.
is_proxy
)
{
new_weight
+=
voter
.
proxied_vote_weight
;
}
/// don't propagate small changes (1 ~= epsilon)
if
(
fabs
(
new_weight
-
voter
.
last_vote_weight
)
>
1
)
{
if
(
voter
.
proxy
)
{
auto
&
proxy
=
_voters
.
get
(
voter
.
proxy
,
"proxy not found"
);
//data corruption
_voters
.
modify
(
proxy
,
0
,
[
&
](
auto
&
p
)
{
p
.
proxied_vote_weight
+=
new_weight
-
voter
.
last_vote_weight
;
}
);
propagate_weight_change
(
proxy
);
}
else
{
auto
delta
=
new_weight
-
voter
.
last_vote_weight
;
for
(
auto
acnt
:
voter
.
producers
)
{
auto
&
pitr
=
_producers
.
get
(
acnt
,
"producer not found"
);
//data corruption
_producers
.
modify
(
pitr
,
0
,
[
&
](
auto
&
p
)
{
p
.
total_votes
+=
delta
;
_gstate
.
total_producer_vote_weight
+=
delta
;
});
}
}
}
_voters
.
modify
(
voter
,
0
,
[
&
](
auto
&
v
)
{
v
.
last_vote_weight
=
new_weight
;
}
);
}
}
/// namespace eosiosystem
contracts/hdddeposit/hdddeposit.cpp
浏览文件 @
f42114ca
...
...
@@ -7,6 +7,7 @@
#include <eosiolib/serialize.hpp>
#include <eosiolib/multi_index.hpp>
#include <eosio.token/eosio.token.hpp>
#include <eosio.system/eosio.system.hpp>
using
namespace
eosio
;
...
...
yta_boot.sh
0 → 100755
浏览文件 @
f42114ca
YTA_BIN_DIR
=
"/Users/wangzhi/yottachain/YTAChain/build/bin"
YTA_CONTRACT_DIR
=
"/Users/wangzhi/YTBP/build/contracts"
YTA_SN_URL
=
"http://152.136.11.212:8888/"
#${YTA_BIN_DIR}/cleos -u ${YTA_SN_URL} get info
#${YTA_BIN_DIR}/cleos -u ${YTA_SN_URL} set contract hdddeposit12 ${YTA_CONTRACT_DIR}/hdddeposit
#解锁钱包
printf
"
\\
n
\\
tUlock your wallet, please input your wallet password...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos wallet unlock
PW5JdTGYVAc3fvNYEMArqGchRK8vkPotRazpVwtwLhSCMrFfWvQkE
#创建账户
printf
"
\\
n
\\
tCreate hdd related account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hddpool12345 YTA7EVUeMmQdQqdkDmir3iw7bNe49R9SrcfXw6secCfY2ve1Tgfzh YTA5dGkW3paV4se44bBH7ise2vLt6BWPBs5dxDU9RFYauxwPoQ6qz
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hdddeposit12 YTA7sBCYKDum3morjrh8ueWE6asMheWFcTMEuF4JpDjyWYqAiGMRJ YTA5xjUZ3XvzDj5C2FZJPh5H5MZpW67Zrje86FvEL1AXDAhRBFEed
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hddlock12345 YTA8aWmhGELYK8diCVY9ioRRq2i7ZAnJC1uH5TrFSLSbtRjgQcEFA YTA7WCpKgdfPimyJCdXkH95njbYcBgMKhJ6sxoQwvS1pubcNoPFoV
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio username1234 YTA68Lb6h941HvVnaJCkV9958BRqBiiauAxQbTCy6iS5H8mtxE29f YTA4uvDGmiLVpodsnXG4D2J8o66gP3HZxT9TC4wDmtdoBHNmZsjUg
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio storename123 YTA69XDMXsk8Rvva5bVZgPkJ7NryxLi9dp8KPAQa2K6RT2jj2qyZz YTA6aeqepyGGEcwVkYg444LbxrQuBFefowXCCiCxCZvLHgM3LR7d2
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hddbasefound YTA6s6CfKM1pLucJLGgMwmD6Nkj2szHviKkWuAHEAdL9N1QfuRMN1 YTA6dMmm5c2e4uSWB5FoYYdosmoUmut3ooDYh5w3crFqGtncFaiJi
#创建9大系统账户
printf
"
\\
n
\\
tCreate YTA system account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.bpay YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.msig YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.names YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.ram YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.ramfee YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.saving YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.stake YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.token YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.upay YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio eosio.vpay YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
#创建账户hdd.pool
printf
"
\\
n
\\
tCreate account -- hdd.pool ...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hdd.pool YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
#创建账户hdd.deposit 存储押金合约部署账户
printf
"
\\
n
\\
tCreate account -- hdd.deposit ...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hdd.deposit YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
#创建账户hdd.lock 锁仓合约部署账户
printf
"
\\
n
\\
tCreate account -- hdd.lock ...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hdd.lock YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
#创建账户hdd.base 基础奖励基金
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
create account eosio hdd.base YTA6btVGr2y4GEEFSjg2STUXnH1h2KEBVL2gq7wrSb4vnJLeFxQDW
#加载系统合约eosio.token
printf
"
\\
n
\\
tLoad eosio.token ...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
set
contract eosio.token
${
YTA_CONTRACT_DIR
}
/eosio.token
#创建50亿个YTT代币(这里的YTT币相当于主网中的EOS)
printf
"
\\
n
\\
tCreate YTT token...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio.token create
'["eosio","5000000000.0000 YTT",0,0,0]'
-p
eosio.token
#发行代币,数量:40000000000,代币符号:YTT
printf
"
\\
n
\\
tIssue YTT to eosio...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio.token issue
'["eosio","4000000000.0000 YTT","issue"]'
-p
eosio
#转账给某用户hddpool12345
printf
"
\\
n
\\
tTransfer some YTT to hddpool12345...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio.token transfer
'["eosio", "hddpool12345","10000.0000 YTT","memo"]'
-p
eosio
#转账给某用户username1234
printf
"
\\
n
\\
tTransfer some YTT to username1234...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio.token transfer
'["eosio", "username1234","10000.0000 YTT","memo"]'
-p
eosio
#加载系统合约eosio.system
printf
"
\\
n
\\
tLoad eosio.system ...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
set
contract eosio
${
YTA_CONTRACT_DIR
}
/eosio.system
#将hdd.pool用户设为特权用户 (否则调用inline actio会有复杂的授权问题)
printf
"
\\
n
\\
tSet hdd.pool to privilege account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio setpriv
'["hdd.pool", 1]'
-p
eosio
#将hdd.deposit 用户设为特权用户 (否则调用inline actio会有复杂的授权问题)
printf
"
\\
n
\\
tSet hdd.deposit to privilege account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio setpriv
'["hdd.deposit", 1]'
-p
eosio
#将hdd.lock 用户设为特权用户 (否则调用inline actio会有复杂的授权问题)
printf
"
\\
n
\\
tSet hdd.lock to privilege account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio setpriv
'["hdd.lock", 1]'
-p
eosio
#将hddpool12345用户设为特权用户 (否则调用inline actio会有复杂的授权问题)
printf
"
\\
n
\\
tSet hddpool12345 to privilege account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio setpriv
'["hddpool12345", 1]'
-p
eosio
#将hdddeposit12用户设为特权用户 (否则调用inline actio会有复杂的授权问题)
printf
"
\\
n
\\
tSet hdddeposit12 to privilege account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio setpriv
'["hdddeposit12", 1]'
-p
eosio
#将hddlock12345用户设为特权用户 (否则调用inline actio会有复杂的授权问题)
printf
"
\\
n
\\
tSet hddlock12345 to privilege account...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
push action eosio setpriv
'["hddlock12345", 1]'
-p
eosio
#部署hddpool合约
printf
"
\\
n
\\
tLoad hddpool contract...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
set
contract hddpool12345
${
YTA_CONTRACT_DIR
}
/hddpool
#部署hdddeposit 押金合约
printf
"
\\
n
\\
tLoad hdddeposit contract...
\\
n
\\
n"
${
YTA_BIN_DIR
}
/cleos
-u
${
YTA_SN_URL
}
set
contract hdddeposit12
${
YTA_CONTRACT_DIR
}
/hdddeposit
yttboot.txt
0 → 100644
浏览文件 @
f42114ca
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录