Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
31dd927
add VaultReward contract
apptreeso Apr 7, 2022
e0b9280
update yarn.lock
apptreeso Apr 7, 2022
6c07439
add VaultReward contract
apptreeso Apr 7, 2022
bed1fdc
update yarn.lock
apptreeso Apr 7, 2022
d710be7
comment out unused replace function
Apr 12, 2022
27a8c14
comment more unused functions
Apr 12, 2022
1747543
Merge branch 'vault-incentive-implementation' of github.com:harmony-o…
apptreeso Apr 13, 2022
c263b9f
update VaultReward contract
apptreeso Apr 13, 2022
6b74213
add unit tests for VaultReward contract
apptreeso Apr 13, 2022
186ddec
add the deployment script for VaultReward contract
apptreeso Apr 13, 2022
1d73b7c
comment out unused replace functions
apptreeso Apr 13, 2022
a5fc7fc
optimize VaultRegistry contract
apptreeso Apr 13, 2022
ee52b89
update migration scripts
apptreeso Apr 13, 2022
2a40596
add onebtc upgrade script
apptreeso Apr 13, 2022
7eef7ba
add VaultReward deployment script
apptreeso Apr 13, 2022
3ee6070
fix reward claim interval
apptreeso Apr 19, 2022
5d58e6a
update unit test for fixed reward claimn interval
apptreeso Apr 19, 2022
a3562af
add IVaultReward interface and update interface path
apptreeso Apr 19, 2022
006bbe3
add data structure for vault stakers
apptreeso Apr 19, 2022
bc94adf
update interface path
apptreeso Apr 19, 2022
ffe1ff4
add VaultReserve contract
apptreeso Apr 19, 2022
741232f
remove checkBalance modifier
apptreeso Apr 19, 2022
1959f25
update withdrawReward function interface
apptreeso Apr 19, 2022
3f364e7
update VaultReward unit test with VaultReserve
apptreeso Apr 19, 2022
7d7334f
update migration scripts
apptreeso Apr 19, 2022
689a99d
update deployment scripts
apptreeso Apr 19, 2022
5a449d9
disable withdrawal if the vault is locked
apptreeso Apr 20, 2022
556c2a3
add function to get the vault expiration time
apptreeso Apr 20, 2022
e1611af
update IVaultReward interface
apptreeso Apr 20, 2022
e5a7363
add test to check the withdrawal possibility according to the vault l…
apptreeso Apr 20, 2022
00446e6
use mod operator in SafeMathUpgradeable library
apptreeso Apr 20, 2022
a10b794
code optimization
apptreeso Apr 20, 2022
7a92758
add vault reward lock functionality and fix withdrawal issue
apptreeso Apr 21, 2022
2600fdd
add claimRewardsAndLock function and fix reward update issue
apptreeso Apr 21, 2022
7c6a4c7
update IVaultRegistry interface
apptreeso Apr 21, 2022
b24e5da
add test for claimRewardsAndLock and withdraw functionalities
apptreeso Apr 21, 2022
e7c5ad3
Move some functions from VaultRegistry to VaultRegistryLib
apptreeso Apr 26, 2022
edd06ec
update migration script with the external linked library
apptreeso Apr 26, 2022
a354ce6
update VaultReward unit test with the external linked library
apptreeso Apr 26, 2022
f638b33
add some more comments on the math in VaultReward.sol
brucdarc Apr 26, 2022
000d2e2
allow anyone to call updateVaultAccClaimableRewards function
apptreeso Apr 27, 2022
580d1be
Merge branch 'vault-incentive-implementation' of github.com:harmony-o…
apptreeso Apr 27, 2022
54f5abc
merge updateVaultAccClaimableRewards functionality
apptreeso Apr 27, 2022
a403347
add collateralDebt field in LockedVault structure
apptreeso Apr 28, 2022
01c01e3
replace collateralUpdatedAt field with accRewardPerSharelUpdatedAt
apptreeso Apr 28, 2022
71b1865
update VaultReward unit tests for replaced collateralUpdatedAt field
apptreeso Apr 28, 2022
01ba0df
disallow locking collateral to the expired vault using vault reward
apptreeso Apr 28, 2022
4dd43be
fix vault expiration check on lockAdditionalCollateralFromVaultReward…
apptreeso Apr 28, 2022
2f82077
fix typo
apptreeso Apr 28, 2022
6ae57f3
update hardhat scripts
Apr 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions contract/bridge/contracts/OneBtc.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ contract OneBtc is ERC20Upgradeable, Issue, Redeem, Replace {
}

event ReportVaultTheft(address indexed vaultId);

event VaultDoublePayment(
address indexed vaultId,
bytes32 leftTxId,
bytes32 rightTxId
);

mapping(bytes32 => bool) public theftReports;

function initialize(IRelay _relay, IExchangeRateOracle _oracle)
Expand Down Expand Up @@ -158,47 +158,47 @@ contract OneBtc is ERC20Upgradeable, Issue, Redeem, Replace {
ERC20Upgradeable._mint(receiver, amount);
}

function requestReplace(
address payable oldVaultId,
uint256 btcAmount,
uint256 griefingCollateral
) external payable {
require(false, "Feature temporarily disabled");
// Replace._requestReplace(oldVaultId, btcAmount, griefingCollateral);
}

function acceptReplace(
address oldVaultId,
address newVaultId,
uint256 btcAmount,
uint256 collateral,
uint256 btcPublicKeyX,
uint256 btcPublicKeyY
) external payable {
require(false, "Feature temporarily disabled");
// Replace._acceptReplace(
// oldVaultId,
// newVaultId,
// btcAmount,
// collateral,
// btcPublicKeyX,
// btcPublicKeyY
// );
}

function executeReplace(
uint256 replaceId,
bytes calldata merkleProof,
bytes calldata rawTx, // avoid compiler error: stack too deep
//bytes calldata _version, bytes calldata _vin, bytes calldata _vout, bytes calldata _locktime,
uint32 height,
uint256 index,
bytes calldata header
) external {
require(false, "Feature temporarily disabled");
// bytes memory _vout = verifyTx(height, index, rawTx, header, merkleProof);
// Replace._executeReplace(replaceId, _vout);
}
// function requestReplace(
// address payable oldVaultId,
// uint256 btcAmount,
// uint256 griefingCollateral
// ) external payable {
// require(false, "Feature temporarily disabled");
// // Replace._requestReplace(oldVaultId, btcAmount, griefingCollateral);
// }

// function acceptReplace(
// address oldVaultId,
// address newVaultId,
// uint256 btcAmount,
// uint256 collateral,
// uint256 btcPublicKeyX,
// uint256 btcPublicKeyY
// ) external payable {
// require(false, "Feature temporarily disabled");
// // Replace._acceptReplace(
// // oldVaultId,
// // newVaultId,
// // btcAmount,
// // collateral,
// // btcPublicKeyX,
// // btcPublicKeyY
// // );
// }

// function executeReplace(
// uint256 replaceId,
// bytes calldata merkleProof,
// bytes calldata rawTx, // avoid compiler error: stack too deep
// //bytes calldata _version, bytes calldata _vin, bytes calldata _vout, bytes calldata _locktime,
// uint32 height,
// uint256 index,
// bytes calldata header
// ) external {
// require(false, "Feature temporarily disabled");
// // bytes memory _vout = verifyTx(height, index, rawTx, header, merkleProof);
// // Replace._executeReplace(replaceId, _vout);
// }

/**
* @dev Report vault misbehavior by providing fraud proof (malicious bitcoin transaction and the corresponding transaction inclusion proof). Fully slashes the vault.
Expand Down
Loading