Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Drop 0.001 BTC lot size
Browse files Browse the repository at this point in the history
Subject to ETHBTC price fluctuation, it's very easy for 0.001 BTC to
require fewer bonds than the opening fee, at which point deposit opening
will fail. We still allow for 0.001 BTC lot size to be used in tests.
  • Loading branch information
Shadowfiend authored and pdyraga committed Sep 15, 2020
1 parent 8f73284 commit f3c6b5d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion solidity/contracts/system/TBTCSystem.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ contract TBTCSystem is Ownable, ITBTCSystem, DepositLog {
uint16 private initialCollateralizedPercent = 150; // percent
uint16 private undercollateralizedThresholdPercent = 125; // percent
uint16 private severelyUndercollateralizedThresholdPercent = 110; // percent
uint64[] lotSizesSatoshis = [10**5, 10**6, 10**7, 2 * 10**7, 5 * 10**7, 10**8]; // [0.001, 0.01, 0.1, 0.2, 0.5, 1.0] BTC
uint64[] lotSizesSatoshis = [10**6, 10**7, 2 * 10**7, 5 * 10**7, 10**8]; // [0.01, 0.1, 0.2, 0.5, 1.0] BTC

uint256 constant governanceTimeDelay = 48 hours;
uint256 constant keepFactoriesUpgradeabilityPeriod = 180 days;
Expand Down
1 change: 1 addition & 0 deletions solidity/contracts/test/system/TBTCSystemStub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ contract TBTCSystemStub is TBTCSystem {
TBTCSystem(_priceFeed, _relay)
public {
// solium-disable-previous-line no-empty-blocks
lotSizesSatoshis = [10**5, 10**6, 10**7, 2 * 10**7, 5 * 10**7, 10**8]; // [0.01, 0.1, 0.2, 0.5, 1.0] BTC
}

function setOraclePrice(uint256 _oraclePrice) external {
Expand Down
6 changes: 5 additions & 1 deletion solidity/test/helpers/fullDeployer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {contract} = require("@openzeppelin/test-environment")
const {deploySystem} = require("./utils.js")
const {deploySystem, increaseTime} = require("./utils.js")

const Deposit = contract.fromArtifact("Deposit")
const BytesLib = contract.fromArtifact("BytesLib")
Expand Down Expand Up @@ -153,6 +153,10 @@ async function deployAndLinkAll(additions = [], substitutions = {}) {
1,
)

await tbtcSystem.beginLotSizesUpdate([100000, 1e8])
await increaseTime(48 * 60 * 60 + 1)
await tbtcSystem.finalizeLotSizesUpdate()

const setupFee = await tbtcSystem.getNewDepositFeeEstimate()
await ecdsaKeepStub.setBondAmount(setupFee)
await ecdsaKeepStub.send(setupFee)
Expand Down

0 comments on commit f3c6b5d

Please sign in to comment.