aboutsummaryrefslogtreecommitdiffstats
path: root/params/gen_dexcon_config.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-12-18 20:25:58 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitb91ee4d6708dd30098268d3fed7761472a77f881 (patch)
treeda80c3f3e3de4848b528c8406942c842b07d1921 /params/gen_dexcon_config.go
parente6db3ea40e521602348b499958a3ff30a5253f8c (diff)
downloaddexon-b91ee4d6708dd30098268d3fed7761472a77f881.tar
dexon-b91ee4d6708dd30098268d3fed7761472a77f881.tar.gz
dexon-b91ee4d6708dd30098268d3fed7761472a77f881.tar.bz2
dexon-b91ee4d6708dd30098268d3fed7761472a77f881.tar.lz
dexon-b91ee4d6708dd30098268d3fed7761472a77f881.tar.xz
dexon-b91ee4d6708dd30098268d3fed7761472a77f881.tar.zst
dexon-b91ee4d6708dd30098268d3fed7761472a77f881.zip
core: vm: add undelegate fund lockup mechanism (#94)
Only allow a user to withdraw funds after a certain lockup period. This way, the fund of a bad actor could be confiscated before he could escape.
Diffstat (limited to 'params/gen_dexcon_config.go')
-rw-r--r--params/gen_dexcon_config.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/params/gen_dexcon_config.go b/params/gen_dexcon_config.go
index 9cd9395cc..55d98ba37 100644
--- a/params/gen_dexcon_config.go
+++ b/params/gen_dexcon_config.go
@@ -18,6 +18,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) {
GenesisCRSText string `json:"genesisCRSText"`
Owner common.Address `json:"owner"`
MinStake *math.HexOrDecimal256 `json:"minStake"`
+ LockupPeriod uint64 `json:"lockupPeriod"`
BlockReward *math.HexOrDecimal256 `json:"blockReward"`
BlockGasLimit uint64 `json:"blockGasLimit"`
NumChains uint32 `json:"numChains"`
@@ -34,6 +35,7 @@ func (d DexconConfig) MarshalJSON() ([]byte, error) {
enc.GenesisCRSText = d.GenesisCRSText
enc.Owner = d.Owner
enc.MinStake = (*math.HexOrDecimal256)(d.MinStake)
+ enc.LockupPeriod = d.LockupPeriod
enc.BlockReward = (*math.HexOrDecimal256)(d.BlockReward)
enc.BlockGasLimit = d.BlockGasLimit
enc.NumChains = d.NumChains
@@ -54,6 +56,7 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error {
GenesisCRSText *string `json:"genesisCRSText"`
Owner *common.Address `json:"owner"`
MinStake *math.HexOrDecimal256 `json:"minStake"`
+ LockupPeriod *uint64 `json:"lockupPeriod"`
BlockReward *math.HexOrDecimal256 `json:"blockReward"`
BlockGasLimit *uint64 `json:"blockGasLimit"`
NumChains *uint32 `json:"numChains"`
@@ -79,6 +82,9 @@ func (d *DexconConfig) UnmarshalJSON(input []byte) error {
if dec.MinStake != nil {
d.MinStake = (*big.Int)(dec.MinStake)
}
+ if dec.LockupPeriod != nil {
+ d.LockupPeriod = *dec.LockupPeriod
+ }
if dec.BlockReward != nil {
d.BlockReward = (*big.Int)(dec.BlockReward)
}