Skip to content

Deposit contract

ZhiChunQi edited this page Jun 30, 2019 · 21 revisions

Contract of deposit:

Mediator 、 Jury and Contract Developer Candidate's margin is operated through the PalletOne deposit contract。deposit contracts are different from smart contracts,This contract is fixed in the core of PalletOne, executed by Mediator, and has functions such as deposit delivery, deposit refunding and deposit forfeiture。In order to avoid Mediator, Jury and Contract Developer in PalletOne to do evil, when users who are willing to become Mediator, Jury and Contract Developer, they must first pay a certain quantity of PalletOne Token as operation deposit to show that they are serious about being Mediator, Jury and Contract Developer.

instruction manual :

Start the./ GPTN program first,Enter the console client by issuing the command./gptn attach

想成为Mediator节点的相关操作

Want to become the relevant operation of Mediator node

节点地址:P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq

节点申请加入超级节点

The node requests to join the supernode

contract.depositContractInvoke("P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq","0","10",["ApplyBecomeMediator","{"applyInfo": "{公司名称:互链云网(北京)科技有限公司,公司邮箱:contract@palletone,key:value}", "account":"P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq", "initPubKey":"2SvBCoCHWA8Zg2Q8v2onmaTeZj6YmWLbp6mzoCZeDwiUcmuqFwd8fZXCfdmEhTodbWaSJ8T7MvjQiZkn4S9VTQnKDrEkETt84Sr58vmjVdhdXNjjzqn8j6oHzvduxGo4UjWB66wd1GFXKoz5XD8hcPDzCyGVqZLjb7wu2pkJxeG1Mt3", "node":"pnode://a18ea75c80aa99eee8e3840a62d9a3dc6c7ccfbd271d53365034009ca10d8423c6381999cf649b92b497a1f0cef3539f92fc222737faf9af7ce31dace3b360ae@127.0.0.1:30303"}"])

节点查看自己的信息

The node views its own information

mediator.getInfo("P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq")

节点查看是否在申请列表中

The node checks to see if it is in the application list

contract.depositContractQuery(["IsInBecomeList","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq"])

申请完后,需等待基金会的审批结果,可随时查看是否在审批同意列表中

After the application, you need to wait for the approval result of the foundation, and you can check whether it is in the approval approval list at any time

contract.depositContractQuery(["IsInAgreeList","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq"])

如果节点已经在审批同意列表中,则即可交付规定保证金数量进入超级节点候选列表,50 0000 0000 dao

If the node is already in the approval consent list, the specified amount of margin can be delivered to the super node candidate list,50 0000 0000 dao

contract.depositContractInvoke("P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq","PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM","5000000000","10",["MediatorPayToDepositContract"])

查看保证金账户信息

Check deposit account information

contract.depositContractQuery(["GetMediatorDeposit","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq"])

节点查看是否在候选列表中

The node checks to see if it is in the candidate list

contract.depositContractQuery(["IsInMediatorCandidateList","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq"])

候选节点申请退出候选列表

Candidate node requests to exit the candidate list

contract.depositContractInvoke("P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq","0","10",["MediatorApplyQuit"])

节点查看是否在申请退出列表中

The node looks to see if it is in the application exit list

contract.depositContractQuery(["IsInQuitList","P1NDwXW5pNtgCn1qgAN9Kxz3RKeP6rrz8xq"])

想成为Jury节点的相关操作

Want to become the relevant operations for the Jury node

节点地址:P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen

节点直接交付规定保证金数量即可进入Jury节点候选列表,10 0000 0000 dao

The node delivers the specified amount of margin directly into the Jury node candidate list,10 0000 0000 dao

contract.depositContractInvoke("P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen","PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM","1000000000","10",["JuryPayToDepositContract"])

节点查看保证金账户信息

Check deposit account information

contract.depositContractQuery(["GetNodeBalance","P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen"])

节点查看是否在候选列表中

The node checks to see if it is in the candidate list

contract.depositContractQuery(["IsInJuryCandidateList","P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen"])

节点申请退出候选列表

The node requests to exit the candidate list

contract.depositContractInvoke("P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen","P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen","0","10",["JuryApplyQuit"])

节点查看是否在申请退出列表中

The node looks to see if it is in the application exit list

contract.depositContractQuery(["IsInQuitList","P12p9Yh9EHVWWUzwtLYqj6FD9FjMn4Sjxen"])

想成为Contract Developer节点的相关操作

The operations that you want to be a Contract Developer node

节点地址:P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh

节点直接交付规定保证金数量即可进入Contract Developer节点列表,1 0000 0000 dao

The node directly delivers the specified amount of margin to enter the list of Contract Developer node,1 0000 0000 dao

contract.depositContractInvoke("P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh","PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM","100000000","10",["DeveloperPayToDepositContract"])

节点查看保证金账户信息

Check deposit account information

contract.depositContractQuery(["GetNodeBalance","P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh"])

节点查看是否在列表中

The node checks to see if it is in the list

contract.depositContractQuery(["IsInDeveloperList","P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh"])

节点申请退出列表

The node requests to exit the candidate list

contract.depositContractInvoke("P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh","P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh","0","10",["DeveloperApplyQuit"])

节点查看是否在申请退出列表中

The node looks to see if it is in the application exit list

contract.depositContractQuery(["IsInQuitList","P1B13A5UV1a9n5LvfzShGCrXNtH4yoiAAjh"])

Mediator:

To join the Mediator pool, applicants first have to submit an application, which needs to be approved by the foundation. Interface call:

  • Application call:

ptn.depositContractInvoke("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","10","10",["ApplyBecomeMediator","{\"key\",\"value\"}"])

Description: The first four parameters are primarily to construct a fee,attention:The fourth parameter is the transaction cost, and the last parenthesis is the function that calls the deposit contract.The fifth parameter is the name of the function;The sixth parameteris a JSON string.(Accept the details of the application submitted by the client)。

  • Check of application list:

ptn.depositContractQuery(["GetBecomeMediatorApplyList"])

instructions:To inquire about deposit contracts and apply for a list of mediators,The parameter is the name of the function。

  • Application processing: by the foundation:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForApplyBecomeMediator","ok","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE"])

instructions:The first four parameters are primarily to construct a fee,attention:At this point, the first parameter must be the address held by the specified foundation.The fourth parameter is the transaction cost,HandleForApplyBecomeMediator:The name of the function;ok: Audit behavior(agree and disagree),If you agree, you will be added to the consent list; otherwise, you will be removed from the application list;P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE:A node address requesting to become Mediator。

  • Check consent list:

ptn.depositContractQuery(["GetAgreeForBecomeMediatorList"])

instructions:To inquire if margin contracts have agreed to become a list of mediators,The parameter is the name of the function。

  • Mediator Security deposit:

ptn.depositContractInvoke("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM","2300","10",["MediatorPayToDepositContract"])

instructions:attention:Here is the call to the deposit function,The first parameter is the address of the node already added to the Mediator agree list,The second parameter is the deposit contract address,The third parameter is the amount of deposit paid(The quota is configured in the configuration file and is temporarily 2000ptn. If the quota is enough, it will be added to the candidate list; if not, it will not be executed;instructions:For the first time, mediator required to pay enough deposit, and after joining the candidate list, it could increase the balance again),The fourth parameter is the transaction cost, and the fifth parameter is the function name.

  • Check the account information of a certain address:

ptn.depositContractQuery(["GetBalanceWithAddr","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE"])

instructions:Check for full information about an account in a deposit contract.The first parameter is the function name, and the second parameter is some account address.

  • Check candidate pool list of Mediator:

ptn.depositContractQuery(["GetListForMediatorCandidate"])

instructions:Consult the list of Mediator candidate pools for deposit contracts,The parameter is the name of the function。

  • Application for deposit:

ptn.depositContractInvoke("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","10","10",["MediatorApplyCashback","100"])

instructions:The first parameter is the request node address.The fourth parameter is the transaction cost.The fifth parameter is the function name.The sixth parameter is the amount of deposit applied.For mediators, the refunded balance should be above the stipulated amount of deposit, or the application was not executed.You can apply for a portion or withdraw the entire balance.

  • Check the withdrawal deposit list:

ptn.depositContractQuery(["GetListForCashbackApplication"])

instructions:Check the list of extraction deposit with the function name as the parameter.

  • The foundation handles refund requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForMediatorApplyCashback","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1545723715","ok"])

instructions:The first four parameters are primarily to construct a fee,attention:this moment,The first parameter must be the address held by the foundation.The fourth parameter is the transaction cost.The fifth parameter is the function name.The sixth parameter is the node address of a deposit application.The seventh parameter is the timestamp at the time the address was applied (see the query list).The eighth parameter is the processing behavior (ok agree or no disagree), agree to update the ledger, do not agree to remove the extraction application list.

  • The foundation or community applies for confiscation of a node:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["ApplyForForfeitureDeposit","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","970","Mediator"])

instructions:The first parameter is the foundation address and the community recognized address.The fourth parameter is the cost of the transaction.The fifth is the name of the function.The sixth is to confiscate the address of a node.The seventh is the amount confiscated.The eighth is the confiscation of node roles(Mediator or Jury or Developer)。

  • Check the confiscation application list:

ptn.depositContractQuery(["GetListForForfeitureApplication"])

instructions:Check the forfeiture application list,The parameter is the name of the function。

  • The foundation handles forfeiture requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForForfeitureApplication","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1545721503","ok"])

instructions:The first four parameters are primarily the construction of a fee,attention:At this time, the first parameter must be the address held by the specified foundation,The fourth parameter is the transaction cost, and the fifth parameter is the function name;The sixth parameter is the confiscated address;The seventh parameter is the timestamp when the address is applied(to check the list to see);The eighth is dealing with behavior(ok agree or no disagree),Agree to update the forfeiture of the books,If you do not agree, the forfeiture application list will be removed。

  • Mediator Apply to exit the candidate list,Exit node:

ptn.depositContractInvoke("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","10","10",["MediatorApplyQuitMediator"])

instructions:The first parameter is the request node address,The fourth parameter is the transaction cost,The fifth parameter is the function name,attention:To apply for exit, the node has already paid the deposit and is in the candidate list.。

  • Check Mediator Application exit list:

ptn.depositContractQuery(["GetQuitMediatorApplyList"])

instructions:Check the forfeiture request exit list,The parameter is the name of the function。

  • The foundation handles Mediator exit requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForApplyQuitMediator","no","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE"])

instructions:The first four parameters are primarily to construct a fee,attention:At this time, the first parameter must be the address held by the specified foundation,The fourth parameter is the transaction cost, and the fifth parameter is the function name;The sixth parameter is the processing behavior(Ok agree or no disagree),Agree to update the forfeiture of the books,If you do not agree, the forfeiture application list will be removed;The seventh parameter is the node address of the request to exit Mediator candidate list.

Jury:

  • Jury pay the deposit:

ptn.depositContractInvoke("P1LeyLG17YeeXqWUMjkSwsZYRqv37P4farb","PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM","300","10",["JuryPayToDepositContract"])

instructions:The first parameter is the delivery address;The second parameter is the contract address of deposit;The third parameter is the delivery amount;The fourth parameter is the transaction cost;The fifth parameter is the function name;attention:(The quota is configured in the configuration file and is temporarily 1000ptn),The quota is enough, then joins the candidate list, insufficient then does not add the candidate list.

  • Check the Jury candidate list:

ptn.depositContractQuery(["GetListForJuryCandidate"])

instructions:To query the Jury candidate list, the parameter is the function name.

  • Check account information for an address:

ptn.depositContractQuery(["GetBalanceWithAddr","P1LeyLG17YeeXqWUMjkSwsZYRqv37P4farb"])

instructions:Checking for full information about an account of a deposit contract. he first parameter is the function name,The second parameter is some account address。* Application for deposit:

ptn.depositContractInvoke("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","10","10",["JuryApplyCashback","100"])

instructions:The first parameter is the request node address,The fourth parameter is the transaction cost,The fifth parameter is the function name,The sixth parameter is the amount of deposit applied,As long as it does not serve on the jury and exceeds the date on which the deposit was secured, the deposit can be withdrawn.

  • Check the withdrawal deposit list:

ptn.depositContractQuery(["GetListForCashbackApplication"])

instructions:Check the withdrawal deposit list,the parameter is the function name.

  • The foundation handles refund requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForJuryApplyCashback","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1545723715","ok"])

instructions:The first four parameters are primarily to construct a fee,attention:At this time, the first parameter must be the address held by the specified foundation,The fourth parameter is the transaction cost,and the fifth parameter is the function name;The sixth parameter is the node address of a deposit application;The seventh parameter is the timestamp when the address is applied(view of checking list);The eighth parameter is the processing behavior(Ok agree or no disagree),Agree to update the ledger,Disagree to remove the extraction application list。

  • The foundation or community applies for the forfeiture of a node:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["ApplyForForfeitureDeposit","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","970","Jury"])

instructions:The first parameter is the foundation address or community recognized address;The fourth parameter is the transaction cost;The fifth is the function name;The sixth is to confiscate a node address;The seventh is the forfeiture amount;The eighth is the confiscation of node roles(Mediator or Jury or Developer)。

  • Check the forfeiture application list:

ptn.depositContractQuery(["GetListForForfeitureApplication"])

instructions:Check the forfeiture application list,the parameter is the name of the function。

  • The foundation handles forfeiture requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForForfeitureApplication","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1545721503","ok"])

instructions:The first four parameters are primarily the construction of a fee,attention:At this time, the first parameter must be the address held by the specified foundation,The fourth parameter is the transaction cost, and the fifth parameter is the function name;The sixth parameter is the confiscated address;The seventh parameter is the timestamp when the address is applied(Query list view);The eighth is dealing with behavior(ok agree and no disagree),Agree to update the forfeiture account.If you do not agree, the forfeiture application list will be removed。

Developer:

  • Developer: pay deposit:

ptn.depositContractInvoke("P1LeyLG17YeeXqWUMjkSwsZYRqv37P4farb","PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM","300","10",["DeveloperPayToDepositContract"])

instructions:The first parameter is the delivery address;The second parameter is the deposit contract address;The third parameter is the delivery amount;The fourth parameter is the transaction cost;The fifth parameter is the function name;attention:(The quota is configured in the configuration file and is temporarily 800ptn), When the quota is enough, the candidate list is added,If not, no candidate list is added。

  • check Developer candidate list:

ptn.depositContractQuery(["GetListForDeveloperCandidate"])

instructions:check Developer candidate list,The parameter is the name of the function。

  • Query for account information at an address:

ptn.depositContractQuery(["GetBalanceWithAddr","P1LeyLG17YeeXqWUMjkSwsZYRqv37P4farb"])

Description: query the margin contract for all information about an account, the first parameter is the name of the function, the second parameter is a certain account address.

  • Application for deposit:

ptn.depositContractInvoke("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","10","10",["DeveloperApplyCashback","100"])

Description: the first parameter is the application node address, the fourth parameter is the transaction cost, the fifth parameter is the name of the function, and the sixth parameter is the application deposit amount,In the case of Developer, the deposit may be drawn as long as it is not in jury service and exceeds the date on which the deposit was secured.

  • Query the withdrawal margin list:

ptn.depositContractQuery(["GetListForCashbackApplication"])

Query the list of extraction margin, parameter is the name of the function.

  • The foundation handles refund requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForDeveloperApplyCashback","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1545723715","ok"])

Description: the first four parameters, mainly to construct a handling charge,**attention **:At this point, the first parameter must be the address held by the specified foundation, the fourth parameter is the transaction cost, and the fifth parameter is the function name;The sixth parameter is the node address of a deposit application;The seventh parameter is the time stamp when the address is applied (see the query list);The eighth parameter is the processing behavior (ok agree or no disagree), agree to update the ledger, do not agree to remove the extraction application list.

  • The foundation or community applies to confiscate a node:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["ApplyForForfeitureDeposit","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","970","Developer"])

Note: the first parameter is the foundation address or community recognized address;The fourth parameter is the transaction cost;The fifth is the function name;The sixth is to confiscate a node's address;The seventh is the confiscation amount;The eighth is the confiscation of node roles(Mediator or Developer or Developer)。

  • Query the forfeiture application list:

ptn.depositContractQuery(["GetListForForfeitureApplication"])

Query the confiscation application list, the parameter is the function name.

  • The foundation handles forfeiture requests:

ptn.depositContractInvoke("P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","P1AV1nRL1yy9GpVbyiZnN4mUawhMmqYwiSc","10","10",["HandleForForfeitureApplication","P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1545721503","ok"])

Description: the first four parameters, mainly to construct a handling charge,attention:At this point, the first parameter must be the address held by the specified foundation, the fourth parameter is the transaction cost, and the fifth parameter is the function name.The sixth parameter is the confiscated address;The seventh parameter is the time stamp when the address is applied (see the query list);The eighth is the processing behavior (ok agree or no disagree), agree to the books confiscated update, do not agree to remove the confiscation application list.

Additional information:

Unlock an address:

personal.unlockAccount("P1CdRTvwTcjmibrTwwM7J6ZnjFPcUqct3yE","1",0)

Description: the first parameter is the unlock address;The second parameter is to change the address password;The third parameter is the unlock time (0 is the permanent unlock)

Clone this wiki locally