@keep-network/tbtc-v2 0.1.1-dev.51 → 0.1.1-dev.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/Bank.json +3 -3
- package/artifacts/Bridge.json +129 -104
- package/artifacts/Deposit.json +7 -7
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/Fraud.json +7 -7
- package/artifacts/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/MovingFunds.json +7 -7
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeaconStub.json +1 -1
- package/artifacts/Redemption.json +7 -7
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/Relay.json +9 -9
- package/artifacts/SortitionPool.json +2 -2
- package/artifacts/Sweep.json +9 -9
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +3 -3
- package/artifacts/TBTCToken.json +3 -3
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +10 -10
- package/artifacts/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/WalletRegistry.json +2 -2
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +9 -9
- package/artifacts/solcInputs/{c0a2aa3c07bd118332a0dc765c7f6da0.json → dcf2fc19e497270603c798faeb0a9ba9.json} +3 -3
- package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +2 -2
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.json +56 -40
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
- package/build/contracts/bridge/BridgeState.sol/BridgeState.json +10 -4
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
- package/build/contracts/bridge/Deposit.sol/Deposit.json +2 -2
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.json +2 -2
- package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.json +2 -2
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/OutboundTx.json +2 -2
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/Redemption.json +2 -2
- package/build/contracts/bridge/Sweep.sol/Sweep.dbg.json +1 -1
- package/build/contracts/bridge/Sweep.sol/Sweep.json +2 -2
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.json +2 -2
- package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
- package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/contracts/bridge/Bridge.sol +30 -20
- package/contracts/bridge/BridgeState.sol +35 -20
- package/contracts/bridge/Wallets.sol +4 -3
- package/export.json +22 -6
- package/package.json +1 -1
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"type": "event"
|
|
106
106
|
}
|
|
107
107
|
],
|
|
108
|
-
"bytecode": "
|
|
109
|
-
"deployedBytecode": "
|
|
108
|
+
"bytecode": "0x610fca61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80634afbe4c91461005b57806399b0b8471461007d578063c87de7f41461009d578063d079fbb1146100bd575b600080fd5b81801561006757600080fd5b5061007b610076366004610d6e565b6100dd565b005b81801561008957600080fd5b5061007b610098366004610db8565b610305565b8180156100a957600080fd5b5061007b6100b8366004610e09565b61053e565b8180156100c957600080fd5b5061007b6100d8366004610e35565b610664565b60028401546001600160a01b0316331461014e5760405162461bcd60e51b815260206004820152602760248201527f43616c6c6572206973206e6f74207468652045434453412057616c6c657420526044820152666567697374727960c81b60648201526084015b60405180910390fd5b600061016261015d8484610963565b610a0d565b6bffffffffffffffffffffffff198116600090815260168701602052604081209192506002820154600160a01b900460ff1660058111156101a5576101a5610e62565b146102185760405162461bcd60e51b815260206004820152602860248201527f45434453412077616c6c657420686173206265656e20616c726561647920726560448201527f67697374657265640000000000000000000000000000000000000000000000006064820152608401610145565b848155600281018054600160a01b63ffffffff42811668010000000000000000027fffffffffffffffffffffff00ffffffffffffffff00000000ffffffffffffffff90931692909217811790925560148881018054606087901c73ffffffffffffffffffffffffffffffffffffffff19909116178082559390930490911691906102a183610e8e565b91906101000a81548163ffffffff021916908363ffffffff16021790555050816bffffffffffffffffffffffff1916857f2dbb47dce81d6b11cca1f1e3b10143d6f7e1e7e92d2dd9aacbb1f875379d308e60405160405180910390a3505050505050565b601483015460601b6bffffffffffffffffffffffff1990811690831614156103955760405162461bcd60e51b815260206004820152602c60248201527f4163746976652077616c6c65742063616e6e6f7420626520636f6e736964657260448201527f656420636c6f736561626c6500000000000000000000000000000000000000006064820152608401610145565b6bffffffffffffffffffffffff1982166000908152601684016020526040902060016002820154600160a01b900460ff1660058111156103d7576103d7610e62565b1461042f5760405162461bcd60e51b815260206004820152602260248201527f45434453412077616c6c6574206d75737420626520696e204c69766520737461604482015261746560f01b6064820152608401610145565b6013840154600282015460009161047c9163ffffffff7c01000000000000000000000000000000000000000000000000000000009092048216916801000000000000000090910416610eb2565b63ffffffff16421015905080806104bb57506013850154600160a01b900467ffffffffffffffff166104af868686610a34565b67ffffffffffffffff16105b61052d5760405162461bcd60e51b815260206004820152603660248201527f57616c6c6574206e6565647320746f206265206f6c6420656e6f756768206f7260448201527f206861766520746f6f20666577207361746f73686973000000000000000000006064820152608401610145565b6105378585610b6c565b5050505050565b60028301546001600160a01b031633146105aa5760405162461bcd60e51b815260206004820152602760248201527f43616c6c6572206973206e6f74207468652045434453412057616c6c657420526044820152666567697374727960c81b6064820152608401610145565b60006105b961015d8484610963565b905060016bffffffffffffffffffffffff1982166000908152601686016020526040902060020154600160a01b900460ff1660058111156105fc576105fc610e62565b146106545760405162461bcd60e51b815260206004820152602260248201527f45434453412077616c6c6574206d75737420626520696e204c69766520737461604482015261746560f01b6064820152608401610145565b61065e8482610b6c565b50505050565b6002820154604080517fcc56238800000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163cc562388916004808301926020929190829003018186803b1580156106c457600080fd5b505afa1580156106d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fc9190610eda565b600381111561070d5761070d610e62565b146107805760405162461bcd60e51b815260206004820152602360248201527f57616c6c6574206372656174696f6e20616c726561647920696e2070726f677260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610145565b601482015460601b6bffffffffffffffffffffffff198116156108cb5760006107aa848385610a34565b6bffffffffffffffffffffffff1983166000908152601686016020526040812060020154601387015492935063ffffffff680100000000000000009091048116926107f6911683610eb2565b63ffffffff1642101590508080156108285750601386015467ffffffffffffffff640100000000909104811690841610155b806108555750601386015467ffffffffffffffff6c01000000000000000000000000909104811690841610155b6108c75760405162461bcd60e51b815260206004820152602660248201527f57616c6c6574206372656174696f6e20636f6e646974696f6e7320617265206e60448201527f6f74206d657400000000000000000000000000000000000000000000000000006064820152608401610145565b5050505b6040517f31fecb80caf1e1128496dd5a6f1083ba29fd5fe64c3fe04e2d1b6f9cfc27d5a390600090a18260020160009054906101000a90046001600160a01b03166001600160a01b03166372cc8c6d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b50505050505050565b60606000610972600284610f02565b61099d57507f02000000000000000000000000000000000000000000000000000000000000006109c0565b507f03000000000000000000000000000000000000000000000000000000000000005b6040517fff00000000000000000000000000000000000000000000000000000000000000821660208201526021810185905260410160405160208183030381529060405291505092915050565b60006020600083516020850160025afa50602060006020600060035afa5050600c51919050565b6bffffffffffffffffffffffff19821660009081526016840160205260408120600101548015610b6457808335610a716040860160208701610f24565b610a816060870160408801610f4a565b604051602001610aee9392919092835260e09190911b7fffffffff0000000000000000000000000000000000000000000000000000000016602083015260c01b7fffffffffffffffff000000000000000000000000000000000000000000000000166024820152602c0190565b6040516020818303038152906040528051906020012014610b515760405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642077616c6c6574206d61696e205554584f20646174610000006044820152606401610145565b610b616060840160408501610f4a565b91505b509392505050565b6bffffffffffffffffffffffff198116600090815260168301602052604090206001810154610ba457610b9f8383610cc0565b610c3c565b60028101805463ffffffff42166c01000000000000000000000000027fffffffffffffffffffffff00ffffffff00000000ffffffffffffffffffffffff909116177402000000000000000000000000000000000000000017905580546040516bffffffffffffffffffffffff19841691907fbdc9ce990a067e5fd3a5d8dfc68e27e9f221aaa3fe55265e0b7e93c460b3efe290600090a35b601483015460601b6bffffffffffffffffffffffff199081169083161415610c7e5760148301805473ffffffffffffffffffffffffffffffffffffffff191690555b60148381018054600160a01b900463ffffffff1691610c9c83610f74565b91906101000a81548163ffffffff021916908363ffffffff16021790555050505050565b6bffffffffffffffffffffffff198116600081815260168401602052604080822060028101805463ffffffff4216700100000000000000000000000000000000027fffffffffffffffffffffff0000000000ffffffffffffffffffffffffffffffff9091161774030000000000000000000000000000000000000000179055805491519093927f68cb496f5e64383745876664ef119840f154a729c03ba866b8aecb5c9f53d51691a3505050565b60008060008060808587031215610d8457600080fd5b5050823594602084013594506040840135936060013592509050565b600060608284031215610db257600080fd5b50919050565b600080600060a08486031215610dcd57600080fd5b8335925060208401356bffffffffffffffffffffffff1981168114610df157600080fd5b9150610e008560408601610da0565b90509250925092565b600080600060608486031215610e1e57600080fd5b505081359360208301359350604090920135919050565b60008060808385031215610e4857600080fd5b82359150610e598460208501610da0565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681811415610ea857610ea8610e78565b6001019392505050565b600063ffffffff808316818516808303821115610ed157610ed1610e78565b01949350505050565b600060208284031215610eec57600080fd5b815160048110610efb57600080fd5b9392505050565b600082610f1f57634e487b7160e01b600052601260045260246000fd5b500690565b600060208284031215610f3657600080fd5b813563ffffffff81168114610efb57600080fd5b600060208284031215610f5c57600080fd5b813567ffffffffffffffff81168114610efb57600080fd5b600063ffffffff821680610f8a57610f8a610e78565b600019019291505056fea2646970667358221220c648e4d72297256883720b0ce612eb0ab993e4ba4856580b064f7d78f6d62df364736f6c63430008090033",
|
|
109
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80634afbe4c91461005b57806399b0b8471461007d578063c87de7f41461009d578063d079fbb1146100bd575b600080fd5b81801561006757600080fd5b5061007b610076366004610d6e565b6100dd565b005b81801561008957600080fd5b5061007b610098366004610db8565b610305565b8180156100a957600080fd5b5061007b6100b8366004610e09565b61053e565b8180156100c957600080fd5b5061007b6100d8366004610e35565b610664565b60028401546001600160a01b0316331461014e5760405162461bcd60e51b815260206004820152602760248201527f43616c6c6572206973206e6f74207468652045434453412057616c6c657420526044820152666567697374727960c81b60648201526084015b60405180910390fd5b600061016261015d8484610963565b610a0d565b6bffffffffffffffffffffffff198116600090815260168701602052604081209192506002820154600160a01b900460ff1660058111156101a5576101a5610e62565b146102185760405162461bcd60e51b815260206004820152602860248201527f45434453412077616c6c657420686173206265656e20616c726561647920726560448201527f67697374657265640000000000000000000000000000000000000000000000006064820152608401610145565b848155600281018054600160a01b63ffffffff42811668010000000000000000027fffffffffffffffffffffff00ffffffffffffffff00000000ffffffffffffffff90931692909217811790925560148881018054606087901c73ffffffffffffffffffffffffffffffffffffffff19909116178082559390930490911691906102a183610e8e565b91906101000a81548163ffffffff021916908363ffffffff16021790555050816bffffffffffffffffffffffff1916857f2dbb47dce81d6b11cca1f1e3b10143d6f7e1e7e92d2dd9aacbb1f875379d308e60405160405180910390a3505050505050565b601483015460601b6bffffffffffffffffffffffff1990811690831614156103955760405162461bcd60e51b815260206004820152602c60248201527f4163746976652077616c6c65742063616e6e6f7420626520636f6e736964657260448201527f656420636c6f736561626c6500000000000000000000000000000000000000006064820152608401610145565b6bffffffffffffffffffffffff1982166000908152601684016020526040902060016002820154600160a01b900460ff1660058111156103d7576103d7610e62565b1461042f5760405162461bcd60e51b815260206004820152602260248201527f45434453412077616c6c6574206d75737420626520696e204c69766520737461604482015261746560f01b6064820152608401610145565b6013840154600282015460009161047c9163ffffffff7c01000000000000000000000000000000000000000000000000000000009092048216916801000000000000000090910416610eb2565b63ffffffff16421015905080806104bb57506013850154600160a01b900467ffffffffffffffff166104af868686610a34565b67ffffffffffffffff16105b61052d5760405162461bcd60e51b815260206004820152603660248201527f57616c6c6574206e6565647320746f206265206f6c6420656e6f756768206f7260448201527f206861766520746f6f20666577207361746f73686973000000000000000000006064820152608401610145565b6105378585610b6c565b5050505050565b60028301546001600160a01b031633146105aa5760405162461bcd60e51b815260206004820152602760248201527f43616c6c6572206973206e6f74207468652045434453412057616c6c657420526044820152666567697374727960c81b6064820152608401610145565b60006105b961015d8484610963565b905060016bffffffffffffffffffffffff1982166000908152601686016020526040902060020154600160a01b900460ff1660058111156105fc576105fc610e62565b146106545760405162461bcd60e51b815260206004820152602260248201527f45434453412077616c6c6574206d75737420626520696e204c69766520737461604482015261746560f01b6064820152608401610145565b61065e8482610b6c565b50505050565b6002820154604080517fcc56238800000000000000000000000000000000000000000000000000000000815290516000926001600160a01b03169163cc562388916004808301926020929190829003018186803b1580156106c457600080fd5b505afa1580156106d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fc9190610eda565b600381111561070d5761070d610e62565b146107805760405162461bcd60e51b815260206004820152602360248201527f57616c6c6574206372656174696f6e20616c726561647920696e2070726f677260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610145565b601482015460601b6bffffffffffffffffffffffff198116156108cb5760006107aa848385610a34565b6bffffffffffffffffffffffff1983166000908152601686016020526040812060020154601387015492935063ffffffff680100000000000000009091048116926107f6911683610eb2565b63ffffffff1642101590508080156108285750601386015467ffffffffffffffff640100000000909104811690841610155b806108555750601386015467ffffffffffffffff6c01000000000000000000000000909104811690841610155b6108c75760405162461bcd60e51b815260206004820152602660248201527f57616c6c6574206372656174696f6e20636f6e646974696f6e7320617265206e60448201527f6f74206d657400000000000000000000000000000000000000000000000000006064820152608401610145565b5050505b6040517f31fecb80caf1e1128496dd5a6f1083ba29fd5fe64c3fe04e2d1b6f9cfc27d5a390600090a18260020160009054906101000a90046001600160a01b03166001600160a01b03166372cc8c6d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b50505050505050565b60606000610972600284610f02565b61099d57507f02000000000000000000000000000000000000000000000000000000000000006109c0565b507f03000000000000000000000000000000000000000000000000000000000000005b6040517fff00000000000000000000000000000000000000000000000000000000000000821660208201526021810185905260410160405160208183030381529060405291505092915050565b60006020600083516020850160025afa50602060006020600060035afa5050600c51919050565b6bffffffffffffffffffffffff19821660009081526016840160205260408120600101548015610b6457808335610a716040860160208701610f24565b610a816060870160408801610f4a565b604051602001610aee9392919092835260e09190911b7fffffffff0000000000000000000000000000000000000000000000000000000016602083015260c01b7fffffffffffffffff000000000000000000000000000000000000000000000000166024820152602c0190565b6040516020818303038152906040528051906020012014610b515760405162461bcd60e51b815260206004820152601d60248201527f496e76616c69642077616c6c6574206d61696e205554584f20646174610000006044820152606401610145565b610b616060840160408501610f4a565b91505b509392505050565b6bffffffffffffffffffffffff198116600090815260168301602052604090206001810154610ba457610b9f8383610cc0565b610c3c565b60028101805463ffffffff42166c01000000000000000000000000027fffffffffffffffffffffff00ffffffff00000000ffffffffffffffffffffffff909116177402000000000000000000000000000000000000000017905580546040516bffffffffffffffffffffffff19841691907fbdc9ce990a067e5fd3a5d8dfc68e27e9f221aaa3fe55265e0b7e93c460b3efe290600090a35b601483015460601b6bffffffffffffffffffffffff199081169083161415610c7e5760148301805473ffffffffffffffffffffffffffffffffffffffff191690555b60148381018054600160a01b900463ffffffff1691610c9c83610f74565b91906101000a81548163ffffffff021916908363ffffffff16021790555050505050565b6bffffffffffffffffffffffff198116600081815260168401602052604080822060028101805463ffffffff4216700100000000000000000000000000000000027fffffffffffffffffffffff0000000000ffffffffffffffffffffffffffffffff9091161774030000000000000000000000000000000000000000179055805491519093927f68cb496f5e64383745876664ef119840f154a729c03ba866b8aecb5c9f53d51691a3505050565b60008060008060808587031215610d8457600080fd5b5050823594602084013594506040840135936060013592509050565b600060608284031215610db257600080fd5b50919050565b600080600060a08486031215610dcd57600080fd5b8335925060208401356bffffffffffffffffffffffff1981168114610df157600080fd5b9150610e008560408601610da0565b90509250925092565b600080600060608486031215610e1e57600080fd5b505081359360208301359350604090920135919050565b60008060808385031215610e4857600080fd5b82359150610e598460208501610da0565b90509250929050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600063ffffffff80831681811415610ea857610ea8610e78565b6001019392505050565b600063ffffffff808316818516808303821115610ed157610ed1610e78565b01949350505050565b600060208284031215610eec57600080fd5b815160048110610efb57600080fd5b9392505050565b600082610f1f57634e487b7160e01b600052601260045260246000fd5b500690565b600060208284031215610f3657600080fd5b813563ffffffff81168114610efb57600080fd5b600060208284031215610f5c57600080fd5b813567ffffffffffffffff81168114610efb57600080fd5b600063ffffffff821680610f8a57610f8a610e78565b600019019291505056fea2646970667358221220c648e4d72297256883720b0ce612eb0ab993e4ba4856580b064f7d78f6d62df364736f6c63430008090033",
|
|
110
110
|
"linkReferences": {},
|
|
111
111
|
"deployedLinkReferences": {}
|
|
112
112
|
}
|
|
@@ -181,8 +181,9 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
181
181
|
|
|
182
182
|
event WalletParametersUpdated(
|
|
183
183
|
uint32 walletCreationPeriod,
|
|
184
|
-
uint64
|
|
185
|
-
uint64
|
|
184
|
+
uint64 walletCreationMinBtcBalance,
|
|
185
|
+
uint64 walletCreationMaxBtcBalance,
|
|
186
|
+
uint64 walletClosureMinBtcBalance,
|
|
186
187
|
uint32 walletMaxAge,
|
|
187
188
|
uint64 walletMaxBtcTransfer,
|
|
188
189
|
uint32 walletClosingPeriod
|
|
@@ -235,8 +236,9 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
235
236
|
self.fraudChallengeDefeatTimeout = 7 days;
|
|
236
237
|
self.fraudChallengeDepositAmount = 2 ether;
|
|
237
238
|
self.walletCreationPeriod = 1 weeks;
|
|
238
|
-
self.
|
|
239
|
-
self.
|
|
239
|
+
self.walletCreationMinBtcBalance = 1e8; // 1 BTC
|
|
240
|
+
self.walletCreationMaxBtcBalance = 100e8; // 100 BTC
|
|
241
|
+
self.walletClosureMinBtcBalance = 5 * 1e7; // 0.5 BTC
|
|
240
242
|
self.walletMaxAge = 26 weeks; // ~6 months
|
|
241
243
|
self.walletMaxBtcTransfer = 10e8; // 10 BTC
|
|
242
244
|
self.walletClosingPeriod = 40 days;
|
|
@@ -960,10 +962,12 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
960
962
|
/// @param walletCreationPeriod New value of the wallet creation period in
|
|
961
963
|
/// seconds, determines how frequently a new wallet creation can be
|
|
962
964
|
/// requested
|
|
963
|
-
/// @param
|
|
964
|
-
/// in satoshi, used to decide about wallet creation
|
|
965
|
-
/// @param
|
|
966
|
-
/// in satoshi, used to decide about wallet creation
|
|
965
|
+
/// @param walletCreationMinBtcBalance New value of the wallet minimum BTC
|
|
966
|
+
/// balance in satoshi, used to decide about wallet creation
|
|
967
|
+
/// @param walletCreationMaxBtcBalance New value of the wallet maximum BTC
|
|
968
|
+
/// balance in satoshi, used to decide about wallet creation
|
|
969
|
+
/// @param walletClosureMinBtcBalance New value of the wallet minimum BTC
|
|
970
|
+
/// balance in satoshi, used to decide about wallet closure
|
|
967
971
|
/// @param walletMaxAge New value of the wallet maximum age in seconds,
|
|
968
972
|
/// indicates the maximum age of a wallet in seconds, after which
|
|
969
973
|
/// the wallet moving funds process can be requested
|
|
@@ -982,16 +986,18 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
982
986
|
/// - Wallet closing period must be greater than zero
|
|
983
987
|
function updateWalletParameters(
|
|
984
988
|
uint32 walletCreationPeriod,
|
|
985
|
-
uint64
|
|
986
|
-
uint64
|
|
989
|
+
uint64 walletCreationMinBtcBalance,
|
|
990
|
+
uint64 walletCreationMaxBtcBalance,
|
|
991
|
+
uint64 walletClosureMinBtcBalance,
|
|
987
992
|
uint32 walletMaxAge,
|
|
988
993
|
uint64 walletMaxBtcTransfer,
|
|
989
994
|
uint32 walletClosingPeriod
|
|
990
995
|
) external onlyGovernance {
|
|
991
996
|
self.updateWalletParameters(
|
|
992
997
|
walletCreationPeriod,
|
|
993
|
-
|
|
994
|
-
|
|
998
|
+
walletCreationMinBtcBalance,
|
|
999
|
+
walletCreationMaxBtcBalance,
|
|
1000
|
+
walletClosureMinBtcBalance,
|
|
995
1001
|
walletMaxAge,
|
|
996
1002
|
walletMaxBtcTransfer,
|
|
997
1003
|
walletClosingPeriod
|
|
@@ -1246,10 +1252,12 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1246
1252
|
|
|
1247
1253
|
/// @return walletCreationPeriod Determines how frequently a new wallet
|
|
1248
1254
|
/// creation can be requested. Value in seconds.
|
|
1249
|
-
/// @return
|
|
1250
|
-
/// used to decide about wallet creation
|
|
1251
|
-
/// @return
|
|
1252
|
-
/// used to decide about wallet creation.
|
|
1255
|
+
/// @return walletCreationMinBtcBalance The minimum BTC threshold in satoshi
|
|
1256
|
+
/// that is used to decide about wallet creation.
|
|
1257
|
+
/// @return walletCreationMaxBtcBalance The maximum BTC threshold in satoshi
|
|
1258
|
+
/// that is used to decide about wallet creation.
|
|
1259
|
+
/// @return walletClosureMinBtcBalance The minimum BTC threshold in satoshi
|
|
1260
|
+
/// that is used to decide about wallet closure.
|
|
1253
1261
|
/// @return walletMaxAge The maximum age of a wallet in seconds, after which
|
|
1254
1262
|
/// the wallet moving funds process can be requested.
|
|
1255
1263
|
/// @return walletMaxBtcTransfer The maximum BTC amount in satoshi than
|
|
@@ -1264,16 +1272,18 @@ contract Bridge is Governable, EcdsaWalletOwner {
|
|
|
1264
1272
|
view
|
|
1265
1273
|
returns (
|
|
1266
1274
|
uint32 walletCreationPeriod,
|
|
1267
|
-
uint64
|
|
1268
|
-
uint64
|
|
1275
|
+
uint64 walletCreationMinBtcBalance,
|
|
1276
|
+
uint64 walletCreationMaxBtcBalance,
|
|
1277
|
+
uint64 walletClosureMinBtcBalance,
|
|
1269
1278
|
uint32 walletMaxAge,
|
|
1270
1279
|
uint64 walletMaxBtcTransfer,
|
|
1271
1280
|
uint32 walletClosingPeriod
|
|
1272
1281
|
)
|
|
1273
1282
|
{
|
|
1274
1283
|
walletCreationPeriod = self.walletCreationPeriod;
|
|
1275
|
-
|
|
1276
|
-
|
|
1284
|
+
walletCreationMinBtcBalance = self.walletCreationMinBtcBalance;
|
|
1285
|
+
walletCreationMaxBtcBalance = self.walletCreationMaxBtcBalance;
|
|
1286
|
+
walletClosureMinBtcBalance = self.walletClosureMinBtcBalance;
|
|
1277
1287
|
walletMaxAge = self.walletMaxAge;
|
|
1278
1288
|
walletMaxBtcTransfer = self.walletMaxBtcTransfer;
|
|
1279
1289
|
walletClosingPeriod = self.walletClosingPeriod;
|
|
@@ -175,11 +175,20 @@ library BridgeState {
|
|
|
175
175
|
// Value in seconds.
|
|
176
176
|
uint32 walletCreationPeriod;
|
|
177
177
|
// The minimum BTC threshold in satoshi that is used to decide about
|
|
178
|
-
// wallet creation
|
|
179
|
-
|
|
178
|
+
// wallet creation. Specifically, we allow for the creation of a new
|
|
179
|
+
// wallet if the active wallet is old enough and their amount of BTC
|
|
180
|
+
// is greater than or equal this threshold.
|
|
181
|
+
uint64 walletCreationMinBtcBalance;
|
|
180
182
|
// The maximum BTC threshold in satoshi that is used to decide about
|
|
181
|
-
// wallet creation.
|
|
182
|
-
|
|
183
|
+
// wallet creation. Specifically, we allow for the creation of a new
|
|
184
|
+
// wallet if the active wallet's amount of BTC is greater than or equal
|
|
185
|
+
// this threshold, regardless of the active wallet's age.
|
|
186
|
+
uint64 walletCreationMaxBtcBalance;
|
|
187
|
+
// The minimum BTC threshold in satoshi that is used to decide about
|
|
188
|
+
// wallet closing. Specifically, we allow for the closure of the given
|
|
189
|
+
// wallet if their amount of BTC is lesser than this threshold,
|
|
190
|
+
// regardless of the wallet's age.
|
|
191
|
+
uint64 walletClosureMinBtcBalance;
|
|
183
192
|
// The maximum age of a wallet in seconds, after which the wallet
|
|
184
193
|
// moving funds process can be requested.
|
|
185
194
|
uint32 walletMaxAge;
|
|
@@ -224,8 +233,9 @@ library BridgeState {
|
|
|
224
233
|
|
|
225
234
|
event WalletParametersUpdated(
|
|
226
235
|
uint32 walletCreationPeriod,
|
|
227
|
-
uint64
|
|
228
|
-
uint64
|
|
236
|
+
uint64 walletCreationMinBtcBalance,
|
|
237
|
+
uint64 walletCreationMaxBtcBalance,
|
|
238
|
+
uint64 walletClosureMinBtcBalance,
|
|
229
239
|
uint32 walletMaxAge,
|
|
230
240
|
uint64 walletMaxBtcTransfer,
|
|
231
241
|
uint32 walletClosingPeriod
|
|
@@ -426,10 +436,12 @@ library BridgeState {
|
|
|
426
436
|
/// @param _walletCreationPeriod New value of the wallet creation period in
|
|
427
437
|
/// seconds, determines how frequently a new wallet creation can be
|
|
428
438
|
/// requested
|
|
429
|
-
/// @param
|
|
430
|
-
/// in satoshi, used to decide about wallet creation
|
|
431
|
-
/// @param
|
|
432
|
-
/// in satoshi, used to decide about wallet creation
|
|
439
|
+
/// @param _walletCreationMinBtcBalance New value of the wallet minimum BTC
|
|
440
|
+
/// balance in satoshi, used to decide about wallet creation
|
|
441
|
+
/// @param _walletCreationMaxBtcBalance New value of the wallet maximum BTC
|
|
442
|
+
/// balance in satoshi, used to decide about wallet creation
|
|
443
|
+
/// @param _walletClosureMinBtcBalance New value of the wallet minimum BTC
|
|
444
|
+
/// balance in satoshi, used to decide about wallet closure
|
|
433
445
|
/// @param _walletMaxAge New value of the wallet maximum age in seconds,
|
|
434
446
|
/// indicates the maximum age of a wallet in seconds, after which
|
|
435
447
|
/// the wallet moving funds process can be requested
|
|
@@ -449,19 +461,20 @@ library BridgeState {
|
|
|
449
461
|
function updateWalletParameters(
|
|
450
462
|
Storage storage self,
|
|
451
463
|
uint32 _walletCreationPeriod,
|
|
452
|
-
uint64
|
|
453
|
-
uint64
|
|
464
|
+
uint64 _walletCreationMinBtcBalance,
|
|
465
|
+
uint64 _walletCreationMaxBtcBalance,
|
|
466
|
+
uint64 _walletClosureMinBtcBalance,
|
|
454
467
|
uint32 _walletMaxAge,
|
|
455
468
|
uint64 _walletMaxBtcTransfer,
|
|
456
469
|
uint32 _walletClosingPeriod
|
|
457
470
|
) internal {
|
|
458
471
|
require(
|
|
459
|
-
|
|
460
|
-
"Wallet
|
|
472
|
+
_walletCreationMaxBtcBalance > _walletCreationMinBtcBalance,
|
|
473
|
+
"Wallet creation maximum BTC balance must be greater than the creation minimum BTC balance"
|
|
461
474
|
);
|
|
462
475
|
require(
|
|
463
|
-
|
|
464
|
-
"Wallet
|
|
476
|
+
_walletClosureMinBtcBalance > 0,
|
|
477
|
+
"Wallet closure minimum BTC balance must be greater than zero"
|
|
465
478
|
);
|
|
466
479
|
require(
|
|
467
480
|
_walletMaxBtcTransfer > 0,
|
|
@@ -473,16 +486,18 @@ library BridgeState {
|
|
|
473
486
|
);
|
|
474
487
|
|
|
475
488
|
self.walletCreationPeriod = _walletCreationPeriod;
|
|
476
|
-
self.
|
|
477
|
-
self.
|
|
489
|
+
self.walletCreationMinBtcBalance = _walletCreationMinBtcBalance;
|
|
490
|
+
self.walletCreationMaxBtcBalance = _walletCreationMaxBtcBalance;
|
|
491
|
+
self.walletClosureMinBtcBalance = _walletClosureMinBtcBalance;
|
|
478
492
|
self.walletMaxAge = _walletMaxAge;
|
|
479
493
|
self.walletMaxBtcTransfer = _walletMaxBtcTransfer;
|
|
480
494
|
self.walletClosingPeriod = _walletClosingPeriod;
|
|
481
495
|
|
|
482
496
|
emit WalletParametersUpdated(
|
|
483
497
|
_walletCreationPeriod,
|
|
484
|
-
|
|
485
|
-
|
|
498
|
+
_walletCreationMinBtcBalance,
|
|
499
|
+
_walletCreationMaxBtcBalance,
|
|
500
|
+
_walletClosureMinBtcBalance,
|
|
486
501
|
_walletMaxAge,
|
|
487
502
|
_walletMaxBtcTransfer,
|
|
488
503
|
_walletClosingPeriod
|
|
@@ -163,8 +163,9 @@ library Wallets {
|
|
|
163
163
|
|
|
164
164
|
require(
|
|
165
165
|
(activeWalletOldEnough &&
|
|
166
|
-
activeWalletBtcBalance >=
|
|
167
|
-
|
|
166
|
+
activeWalletBtcBalance >=
|
|
167
|
+
self.walletCreationMinBtcBalance) ||
|
|
168
|
+
activeWalletBtcBalance >= self.walletCreationMaxBtcBalance,
|
|
168
169
|
"Wallet creation conditions are not met"
|
|
169
170
|
);
|
|
170
171
|
}
|
|
@@ -356,7 +357,7 @@ library Wallets {
|
|
|
356
357
|
require(
|
|
357
358
|
walletOldEnough ||
|
|
358
359
|
getWalletBtcBalance(self, walletPubKeyHash, walletMainUtxo) <
|
|
359
|
-
self.
|
|
360
|
+
self.walletClosureMinBtcBalance,
|
|
360
361
|
"Wallet needs to be old enough or have too few satoshis"
|
|
361
362
|
);
|
|
362
363
|
|
package/export.json
CHANGED
|
@@ -14574,13 +14574,19 @@
|
|
|
14574
14574
|
{
|
|
14575
14575
|
"indexed": false,
|
|
14576
14576
|
"internalType": "uint64",
|
|
14577
|
-
"name": "
|
|
14577
|
+
"name": "walletCreationMinBtcBalance",
|
|
14578
14578
|
"type": "uint64"
|
|
14579
14579
|
},
|
|
14580
14580
|
{
|
|
14581
14581
|
"indexed": false,
|
|
14582
14582
|
"internalType": "uint64",
|
|
14583
|
-
"name": "
|
|
14583
|
+
"name": "walletCreationMaxBtcBalance",
|
|
14584
|
+
"type": "uint64"
|
|
14585
|
+
},
|
|
14586
|
+
{
|
|
14587
|
+
"indexed": false,
|
|
14588
|
+
"internalType": "uint64",
|
|
14589
|
+
"name": "walletClosureMinBtcBalance",
|
|
14584
14590
|
"type": "uint64"
|
|
14585
14591
|
},
|
|
14586
14592
|
{
|
|
@@ -16119,12 +16125,17 @@
|
|
|
16119
16125
|
},
|
|
16120
16126
|
{
|
|
16121
16127
|
"internalType": "uint64",
|
|
16122
|
-
"name": "
|
|
16128
|
+
"name": "walletCreationMinBtcBalance",
|
|
16123
16129
|
"type": "uint64"
|
|
16124
16130
|
},
|
|
16125
16131
|
{
|
|
16126
16132
|
"internalType": "uint64",
|
|
16127
|
-
"name": "
|
|
16133
|
+
"name": "walletCreationMaxBtcBalance",
|
|
16134
|
+
"type": "uint64"
|
|
16135
|
+
},
|
|
16136
|
+
{
|
|
16137
|
+
"internalType": "uint64",
|
|
16138
|
+
"name": "walletClosureMinBtcBalance",
|
|
16128
16139
|
"type": "uint64"
|
|
16129
16140
|
},
|
|
16130
16141
|
{
|
|
@@ -16159,12 +16170,17 @@
|
|
|
16159
16170
|
},
|
|
16160
16171
|
{
|
|
16161
16172
|
"internalType": "uint64",
|
|
16162
|
-
"name": "
|
|
16173
|
+
"name": "walletCreationMinBtcBalance",
|
|
16174
|
+
"type": "uint64"
|
|
16175
|
+
},
|
|
16176
|
+
{
|
|
16177
|
+
"internalType": "uint64",
|
|
16178
|
+
"name": "walletCreationMaxBtcBalance",
|
|
16163
16179
|
"type": "uint64"
|
|
16164
16180
|
},
|
|
16165
16181
|
{
|
|
16166
16182
|
"internalType": "uint64",
|
|
16167
|
-
"name": "
|
|
16183
|
+
"name": "walletClosureMinBtcBalance",
|
|
16168
16184
|
"type": "uint64"
|
|
16169
16185
|
},
|
|
16170
16186
|
{
|