Renamed xxxReward... to StakingPoolReward...
This commit is contained in:
@@ -21,13 +21,13 @@ pragma solidity ^0.5.9;
|
||||
import "./interfaces/IStaking.sol";
|
||||
import "./core/MixinExchangeManager.sol";
|
||||
import "./core/MixinZrxVault.sol";
|
||||
import "./core/MixinRewardVault.sol";
|
||||
import "./core/MixinStakingPoolRewardVault.sol";
|
||||
import "./core/MixinScheduler.sol";
|
||||
import "./core/MixinStakeBalances.sol";
|
||||
import "./core/MixinStake.sol";
|
||||
import "./core/MixinStakingPool.sol";
|
||||
import "./core/MixinExchangeFees.sol";
|
||||
import "./core/MixinRewards.sol";
|
||||
import "./core/MixinStakingPoolRewards.sol";
|
||||
|
||||
|
||||
contract Staking is
|
||||
@@ -36,12 +36,12 @@ contract Staking is
|
||||
MixinConstants,
|
||||
MixinStorage,
|
||||
MixinScheduler,
|
||||
MixinRewardVault,
|
||||
MixinStakingPoolRewardVault,
|
||||
MixinZrxVault,
|
||||
MixinExchangeManager,
|
||||
MixinStakeBalances,
|
||||
MixinStakingPool,
|
||||
MixinRewards,
|
||||
MixinStakingPoolRewards,
|
||||
MixinStake,
|
||||
MixinExchangeFees
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ import "./MixinStakeBalances.sol";
|
||||
import "./MixinScheduler.sol";
|
||||
import "./MixinStakingPool.sol";
|
||||
import "./MixinExchangeManager.sol";
|
||||
import "./MixinRewardVault.sol";
|
||||
import "./MixinStakingPoolRewardVault.sol";
|
||||
import "../interfaces/IStructs.sol";
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ contract MixinExchangeFees is
|
||||
MixinConstants,
|
||||
MixinStorage,
|
||||
MixinScheduler,
|
||||
MixinRewardVault,
|
||||
MixinStakingPoolRewardVault,
|
||||
MixinExchangeManager,
|
||||
MixinStakeBalances,
|
||||
MixinStakingPool
|
||||
@@ -121,7 +121,7 @@ contract MixinExchangeFees is
|
||||
/// Each pool receives a portion of the fees generated this epoch (see LibFeeMath) that is
|
||||
/// proportional to (i) the fee volume attributed to their pool over the epoch, and
|
||||
/// (ii) the amount of stake provided by the maker and their delegators. Rebates are paid
|
||||
/// into the Reward Vault (see MixinRewardVault) where they can be withdraw by makers and
|
||||
/// into the Reward Vault (see MixinStakingPoolRewardVault) where they can be withdraw by makers and
|
||||
/// the members of their pool. There will be a small amount of ETH leftover in this contract
|
||||
/// after paying out the rebates; at present, this rolls over into the next epoch. Eventually,
|
||||
/// we plan to deposit this leftover into a DAO managed by the 0x community.
|
||||
@@ -211,7 +211,7 @@ contract MixinExchangeFees is
|
||||
);
|
||||
|
||||
// record reward in vault
|
||||
_recordDepositInRewardVault(activePools[i].poolId, reward);
|
||||
_recordDepositInStakingPoolRewardVault(activePools[i].poolId, reward);
|
||||
totalRewardsPaid = totalRewardsPaid._add(reward);
|
||||
|
||||
// clear state for gas refunds
|
||||
@@ -226,7 +226,7 @@ contract MixinExchangeFees is
|
||||
"MISCALCULATED_REWARDS"
|
||||
);
|
||||
if (totalRewardsPaid > 0) {
|
||||
_depositIntoRewardVault(totalRewardsPaid);
|
||||
_depositIntoStakingPoolRewardVault(totalRewardsPaid);
|
||||
}
|
||||
finalContractBalance = address(this).balance;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import "../immutable/MixinConstants.sol";
|
||||
import "../immutable/MixinStorage.sol";
|
||||
import "../interfaces/IStakingEvents.sol";
|
||||
import "./MixinZrxVault.sol";
|
||||
import "./MixinRewardVault.sol";
|
||||
import "./MixinStakingPoolRewardVault.sol";
|
||||
import "./MixinScheduler.sol";
|
||||
import "./MixinStakeBalances.sol";
|
||||
|
||||
@@ -34,7 +34,7 @@ contract MixinStake is
|
||||
MixinConstants,
|
||||
MixinStorage,
|
||||
MixinScheduler,
|
||||
MixinRewardVault,
|
||||
MixinStakingPoolRewardVault,
|
||||
MixinZrxVault,
|
||||
MixinStakeBalances
|
||||
{
|
||||
@@ -178,7 +178,7 @@ contract MixinStake is
|
||||
|
||||
// update delegator's share of reward pool
|
||||
// note that this uses the snapshot parameters
|
||||
uint256 poolBalance = getBalanceOfPoolInRewardVault(poolId);
|
||||
uint256 poolBalance = getBalanceOfPoolInStakingPoolRewardVault(poolId);
|
||||
uint256 buyIn = LibRewardMath._computeBuyInDenominatedInShadowAsset(
|
||||
amount,
|
||||
_delegatedStakeByPoolId,
|
||||
@@ -211,7 +211,7 @@ contract MixinStake is
|
||||
|
||||
// get payout
|
||||
// TODO -- not full balance, just balance that belongs to delegators.
|
||||
uint256 poolBalance = getBalanceOfPoolInRewardVault(poolId);
|
||||
uint256 poolBalance = getBalanceOfPoolInStakingPoolRewardVault(poolId);
|
||||
uint256 payoutInRealAsset;
|
||||
uint256 payoutInShadowAsset;
|
||||
if (_delegatedStakeToPoolByOwner == amount) {
|
||||
@@ -240,7 +240,7 @@ contract MixinStake is
|
||||
|
||||
// withdraw payout for delegator
|
||||
if (payoutInRealAsset > 0) {
|
||||
_withdrawFromPoolInRewardVault(poolId, payoutInRealAsset);
|
||||
_withdrawFromPoolInStakingPoolRewardVault(poolId, payoutInRealAsset);
|
||||
owner.transfer(payoutInRealAsset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ import "../interfaces/IStructs.sol";
|
||||
import "../interfaces/IStakingEvents.sol";
|
||||
import "../immutable/MixinConstants.sol";
|
||||
import "../immutable/MixinStorage.sol";
|
||||
import "./MixinRewardVault.sol";
|
||||
import "./MixinStakingPoolRewardVault.sol";
|
||||
|
||||
|
||||
contract MixinStakingPool is
|
||||
IStakingEvents,
|
||||
MixinConstants,
|
||||
MixinStorage,
|
||||
MixinRewardVault
|
||||
MixinStakingPoolRewardVault
|
||||
{
|
||||
|
||||
using LibSafeMath for uint256;
|
||||
@@ -108,7 +108,7 @@ contract MixinStakingPool is
|
||||
poolById[poolId] = pool;
|
||||
|
||||
// register pool in reward vault
|
||||
_createPoolInRewardVault(poolId, operatorShare);
|
||||
_createPoolInStakingPoolRewardVault(poolId, operatorShare);
|
||||
|
||||
// notify
|
||||
emit StakingPoolCreated(poolId, operatorAddress, operatorShare);
|
||||
|
||||
@@ -18,22 +18,22 @@
|
||||
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "../interfaces/IRewardVault.sol";
|
||||
import "../interfaces/IStakingPoolRewardVault.sol";
|
||||
import "../immutable/MixinStorage.sol";
|
||||
|
||||
|
||||
contract MixinRewardVault is
|
||||
contract MixinStakingPoolRewardVault is
|
||||
MixinStorage
|
||||
{
|
||||
|
||||
function setRewardVault(address payable _rewardVault)
|
||||
function setStakingPoolRewardVault(address payable _rewardVault)
|
||||
external
|
||||
// onlyOwner
|
||||
{
|
||||
rewardVault = IRewardVault(_rewardVault);
|
||||
rewardVault = IStakingPoolRewardVault(_rewardVault);
|
||||
}
|
||||
|
||||
function getRewardVault()
|
||||
function getStakingPoolRewardVault()
|
||||
public
|
||||
view
|
||||
returns (address)
|
||||
@@ -41,7 +41,7 @@ contract MixinRewardVault is
|
||||
return address(rewardVault);
|
||||
}
|
||||
|
||||
function getBalanceInRewardVault(bytes32 poolId)
|
||||
function getBalanceInStakingPoolRewardVault(bytes32 poolId)
|
||||
public
|
||||
view
|
||||
returns (uint256)
|
||||
@@ -49,7 +49,7 @@ contract MixinRewardVault is
|
||||
return rewardVault.balanceOf(poolId);
|
||||
}
|
||||
|
||||
function getBalanceOfOperatorInRewardVault(bytes32 poolId)
|
||||
function getBalanceOfOperatorInStakingPoolRewardVault(bytes32 poolId)
|
||||
public
|
||||
view
|
||||
returns (uint256)
|
||||
@@ -57,7 +57,7 @@ contract MixinRewardVault is
|
||||
return rewardVault.balanceOfOperator(poolId);
|
||||
}
|
||||
|
||||
function getBalanceOfPoolInRewardVault(bytes32 poolId)
|
||||
function getBalanceOfPoolInStakingPoolRewardVault(bytes32 poolId)
|
||||
public
|
||||
view
|
||||
returns (uint256)
|
||||
@@ -65,7 +65,7 @@ contract MixinRewardVault is
|
||||
return rewardVault.balanceOfPool(poolId);
|
||||
}
|
||||
|
||||
function _createPoolInRewardVault(bytes32 poolId, uint8 operatorShare)
|
||||
function _createPoolInStakingPoolRewardVault(bytes32 poolId, uint8 operatorShare)
|
||||
internal
|
||||
{
|
||||
rewardVault.createPool(
|
||||
@@ -74,26 +74,26 @@ contract MixinRewardVault is
|
||||
);
|
||||
}
|
||||
|
||||
function _withdrawFromPoolInRewardVault(bytes32 poolId, uint256 amount)
|
||||
function _withdrawFromPoolInStakingPoolRewardVault(bytes32 poolId, uint256 amount)
|
||||
internal
|
||||
{
|
||||
rewardVault.withdrawFromPool(poolId, amount);
|
||||
}
|
||||
|
||||
function _withdrawFromOperatorInRewardVault(bytes32 poolId, uint256 amount)
|
||||
function _withdrawFromOperatorInStakingPoolRewardVault(bytes32 poolId, uint256 amount)
|
||||
internal
|
||||
{
|
||||
rewardVault.withdrawFromOperator(poolId, amount);
|
||||
}
|
||||
|
||||
function _depositIntoRewardVault(uint256 amountInWei)
|
||||
function _depositIntoStakingPoolRewardVault(uint256 amountInWei)
|
||||
internal
|
||||
{
|
||||
address payable rewardVaultAddress = address(uint160(address(rewardVault)));
|
||||
rewardVaultAddress.transfer(amountInWei);
|
||||
}
|
||||
|
||||
function _recordDepositInRewardVault(bytes32 poolId, uint256 amount)
|
||||
function _recordDepositInStakingPoolRewardVault(bytes32 poolId, uint256 amount)
|
||||
internal
|
||||
{
|
||||
rewardVault.recordDepositFor(poolId, amount);
|
||||
@@ -23,27 +23,28 @@ import "../libs/LibRewardMath.sol";
|
||||
import "../immutable/MixinStorage.sol";
|
||||
import "../immutable/MixinConstants.sol";
|
||||
import "./MixinStakeBalances.sol";
|
||||
import "./MixinRewardVault.sol";
|
||||
import "./MixinStakingPoolRewardVault.sol";
|
||||
import "./MixinStakingPool.sol";
|
||||
|
||||
|
||||
contract MixinRewards is
|
||||
contract MixinStakingPoolRewards is
|
||||
MixinConstants,
|
||||
MixinStorage,
|
||||
MixinRewardVault,
|
||||
MixinStakingPoolRewardVault,
|
||||
MixinStakeBalances,
|
||||
MixinStakingPool
|
||||
{
|
||||
|
||||
using LibSafeMath for uint256;
|
||||
|
||||
/// @dev This mixin contains logic for managing the reward pool
|
||||
/// @dev This mixin contains logic for managing the rewards belonging to a staking pool.
|
||||
///
|
||||
|
||||
function withdrawOperatorReward(bytes32 poolId, uint256 amount)
|
||||
external
|
||||
onlyPoolOperator(poolId)
|
||||
{
|
||||
_withdrawFromOperatorInRewardVault(poolId, amount);
|
||||
_withdrawFromOperatorInStakingPoolRewardVault(poolId, amount);
|
||||
poolById[poolId].operatorAddress.transfer(amount);
|
||||
}
|
||||
|
||||
@@ -60,7 +61,7 @@ contract MixinRewards is
|
||||
shadowRewardsInPoolByOwner[owner][poolId] = shadowRewardsInPoolByOwner[owner][poolId]._add(amount);
|
||||
shadowRewardsByPoolId[poolId] = shadowRewardsByPoolId[poolId]._add(amount);
|
||||
|
||||
_withdrawFromPoolInRewardVault(poolId, amount);
|
||||
_withdrawFromPoolInStakingPoolRewardVault(poolId, amount);
|
||||
owner.transfer(amount);
|
||||
}
|
||||
|
||||
@@ -69,8 +70,8 @@ contract MixinRewards is
|
||||
onlyPoolOperator(poolId)
|
||||
returns (uint256)
|
||||
{
|
||||
uint256 amount = getBalanceOfOperatorInRewardVault(poolId);
|
||||
_withdrawFromOperatorInRewardVault(poolId, amount);
|
||||
uint256 amount = getBalanceOfOperatorInStakingPoolRewardVault(poolId);
|
||||
_withdrawFromOperatorInStakingPoolRewardVault(poolId, amount);
|
||||
poolById[poolId].operatorAddress.transfer(amount);
|
||||
|
||||
return amount;
|
||||
@@ -86,7 +87,7 @@ contract MixinRewards is
|
||||
shadowRewardsInPoolByOwner[owner][poolId] = shadowRewardsInPoolByOwner[owner][poolId]._add(amount);
|
||||
shadowRewardsByPoolId[poolId] = shadowRewardsByPoolId[poolId]._add(amount);
|
||||
|
||||
_withdrawFromPoolInRewardVault(poolId, amount);
|
||||
_withdrawFromPoolInStakingPoolRewardVault(poolId, amount);
|
||||
owner.transfer(amount);
|
||||
|
||||
return amount;
|
||||
@@ -97,7 +98,7 @@ contract MixinRewards is
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
return getBalanceInRewardVault(poolId);
|
||||
return getBalanceInStakingPoolRewardVault(poolId);
|
||||
}
|
||||
|
||||
function getRewardBalanceOfOperator(bytes32 poolId)
|
||||
@@ -105,7 +106,7 @@ contract MixinRewards is
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
return getBalanceOfOperatorInRewardVault(poolId);
|
||||
return getBalanceOfOperatorInStakingPoolRewardVault(poolId);
|
||||
}
|
||||
|
||||
function getRewardBalanceOfPool(bytes32 poolId)
|
||||
@@ -113,7 +114,7 @@ contract MixinRewards is
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
return getBalanceOfPoolInRewardVault(poolId);
|
||||
return getBalanceOfPoolInStakingPoolRewardVault(poolId);
|
||||
}
|
||||
|
||||
function computeRewardBalance(bytes32 poolId, address owner)
|
||||
@@ -121,7 +122,7 @@ contract MixinRewards is
|
||||
view
|
||||
returns (uint256)
|
||||
{
|
||||
uint256 poolBalance = getBalanceOfPoolInRewardVault(poolId);
|
||||
uint256 poolBalance = getBalanceOfPoolInStakingPoolRewardVault(poolId);
|
||||
return LibRewardMath._computePayoutDenominatedInRealAsset(
|
||||
delegatedStakeToPoolByOwner[owner][poolId],
|
||||
delegatedStakeByPoolId[poolId],
|
||||
@@ -19,7 +19,7 @@
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
import "../interfaces/IZrxVault.sol";
|
||||
import "../interfaces/IRewardVault.sol";
|
||||
import "../interfaces/IStakingPoolRewardVault.sol";
|
||||
import "./MixinConstants.sol";
|
||||
import "../interfaces/IStructs.sol";
|
||||
|
||||
@@ -102,5 +102,5 @@ contract MixinStorage is
|
||||
IZrxVault internal zrxVault;
|
||||
|
||||
// Rebate Vault
|
||||
IRewardVault internal rewardVault;
|
||||
IStakingPoolRewardVault internal rewardVault;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
pragma solidity ^0.5.5;
|
||||
|
||||
|
||||
interface IRewardVault {
|
||||
interface IStakingPoolRewardVault {
|
||||
|
||||
function ()
|
||||
external
|
||||
@@ -21,12 +21,12 @@ pragma solidity ^0.5.5;
|
||||
import "../libs/LibSafeMath.sol";
|
||||
import "../libs/LibSafeMath96.sol";
|
||||
import "./MixinVaultCore.sol";
|
||||
import "../interfaces/IRewardVault.sol";
|
||||
import "../interfaces/IStakingPoolRewardVault.sol";
|
||||
import "../immutable/MixinConstants.sol";
|
||||
|
||||
|
||||
contract RewardVault is
|
||||
IRewardVault,
|
||||
contract StakingPoolRewardVault is
|
||||
IStakingPoolRewardVault,
|
||||
MixinConstants,
|
||||
MixinVaultCore
|
||||
{
|
||||
@@ -36,7 +36,7 @@
|
||||
"compile:truffle": "truffle compile"
|
||||
},
|
||||
"config": {
|
||||
"abis": "./generated-artifacts/@(LibFeeMathTest|LibZrxToken|MixinStake|RewardVault|Staking|StakingProxy|ZrxVault).json",
|
||||
"abis": "./generated-artifacts/@(LibFeeMathTest|LibZrxToken|MixinStake|Staking|StakingPoolRewardVault|StakingProxy|ZrxVault).json",
|
||||
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@@ -8,8 +8,8 @@ import { ContractArtifact } from 'ethereum-types';
|
||||
import * as LibFeeMathTest from '../generated-artifacts/LibFeeMathTest.json';
|
||||
import * as LibZrxToken from '../generated-artifacts/LibZrxToken.json';
|
||||
import * as MixinStake from '../generated-artifacts/MixinStake.json';
|
||||
import * as RewardVault from '../generated-artifacts/RewardVault.json';
|
||||
import * as Staking from '../generated-artifacts/Staking.json';
|
||||
import * as StakingPoolRewardVault from '../generated-artifacts/StakingPoolRewardVault.json';
|
||||
import * as StakingProxy from '../generated-artifacts/StakingProxy.json';
|
||||
import * as ZrxVault from '../generated-artifacts/ZrxVault.json';
|
||||
export const artifacts = {
|
||||
@@ -17,7 +17,7 @@ export const artifacts = {
|
||||
StakingProxy: StakingProxy as ContractArtifact,
|
||||
MixinStake: MixinStake as ContractArtifact,
|
||||
LibZrxToken: LibZrxToken as ContractArtifact,
|
||||
RewardVault: RewardVault as ContractArtifact,
|
||||
StakingPoolRewardVault: StakingPoolRewardVault as ContractArtifact,
|
||||
ZrxVault: ZrxVault as ContractArtifact,
|
||||
LibFeeMathTest: LibFeeMathTest as ContractArtifact,
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
export * from '../generated-wrappers/lib_fee_math_test';
|
||||
export * from '../generated-wrappers/lib_zrx_token';
|
||||
export * from '../generated-wrappers/mixin_stake';
|
||||
export * from '../generated-wrappers/reward_vault';
|
||||
export * from '../generated-wrappers/staking';
|
||||
export * from '../generated-wrappers/staking_pool_reward_vault';
|
||||
export * from '../generated-wrappers/staking_proxy';
|
||||
export * from '../generated-wrappers/zrx_vault';
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as _ from 'lodash';
|
||||
import {
|
||||
artifacts,
|
||||
LibFeeMathTestContract,
|
||||
RewardVaultContract,
|
||||
StakingPoolRewardVaultContract,
|
||||
StakingContract,
|
||||
StakingProxyContract,
|
||||
ZrxVaultContract,
|
||||
@@ -32,7 +32,7 @@ export class StakingWrapper {
|
||||
private _stakingContractIfExists?: StakingContract;
|
||||
private _stakingProxyContractIfExists?: StakingProxyContract;
|
||||
private _zrxVaultContractIfExists?: ZrxVaultContract;
|
||||
private _rewardVaultContractIfExists?: RewardVaultContract;
|
||||
private _rewardVaultContractIfExists?: StakingPoolRewardVaultContract;
|
||||
private _LibFeeMathTestContractIfExists?: LibFeeMathTestContract;
|
||||
public static toBaseUnitAmount(amount: BigNumber | number): BigNumber {
|
||||
const decimals = 18;
|
||||
@@ -90,9 +90,9 @@ export class StakingWrapper {
|
||||
this._validateDeployedOrThrow();
|
||||
return this._zrxVaultContractIfExists as ZrxVaultContract;
|
||||
}
|
||||
public getRewardVaultContract(): RewardVaultContract {
|
||||
public getStakingPoolRewardVaultContract(): StakingPoolRewardVaultContract {
|
||||
this._validateDeployedOrThrow();
|
||||
return this._rewardVaultContractIfExists as RewardVaultContract;
|
||||
return this._rewardVaultContractIfExists as StakingPoolRewardVaultContract;
|
||||
}
|
||||
public getLibFeeMathTestContract(): LibFeeMathTestContract {
|
||||
this._validateDeployedOrThrow();
|
||||
@@ -110,8 +110,8 @@ export class StakingWrapper {
|
||||
zrxAssetData,
|
||||
);
|
||||
// deploy reward vault
|
||||
this._rewardVaultContractIfExists = await RewardVaultContract.deployFrom0xArtifactAsync(
|
||||
artifacts.RewardVault,
|
||||
this._rewardVaultContractIfExists = await StakingPoolRewardVaultContract.deployFrom0xArtifactAsync(
|
||||
artifacts.StakingPoolRewardVault,
|
||||
this._provider,
|
||||
txDefaults,
|
||||
);
|
||||
@@ -156,17 +156,17 @@ export class StakingWrapper {
|
||||
(this._stakingProxyContractIfExists).address,
|
||||
);
|
||||
// set reward vault in staking contract
|
||||
const setRewardVaultCalldata = (this
|
||||
._stakingContractIfExists).setRewardVault.getABIEncodedTransactionData(
|
||||
const setStakingPoolRewardVaultCalldata = (this
|
||||
._stakingContractIfExists).setStakingPoolRewardVault.getABIEncodedTransactionData(
|
||||
(this._rewardVaultContractIfExists).address,
|
||||
);
|
||||
const setRewardVaultTxData = {
|
||||
const setStakingPoolRewardVaultTxData = {
|
||||
from: this._ownerAddress,
|
||||
to: (this._stakingProxyContractIfExists).address,
|
||||
data: setRewardVaultCalldata,
|
||||
data: setStakingPoolRewardVaultCalldata,
|
||||
};
|
||||
await this._web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await this._web3Wrapper.sendTransactionAsync(setRewardVaultTxData),
|
||||
await this._web3Wrapper.sendTransactionAsync(setStakingPoolRewardVaultTxData),
|
||||
);
|
||||
// deploy libmath test
|
||||
this._LibFeeMathTestContractIfExists = await LibFeeMathTestContract.deployFrom0xArtifactAsync(
|
||||
@@ -601,27 +601,27 @@ export class StakingWrapper {
|
||||
amount: BigNumber,
|
||||
stakingContractAddress: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const calldata = this.getRewardVaultContract().depositFor.getABIEncodedTransactionData(poolId);
|
||||
const calldata = this.getStakingPoolRewardVaultContract().depositFor.getABIEncodedTransactionData(poolId);
|
||||
const txReceipt = await this._executeTransactionAsync(calldata, stakingContractAddress, amount);
|
||||
return txReceipt;
|
||||
}
|
||||
public async rewardVaultEnterCatastrophicFailureModeAsync(
|
||||
zeroExMultisigAddress: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const calldata = this.getRewardVaultContract().enterCatostrophicFailure.getABIEncodedTransactionData();
|
||||
const calldata = this.getStakingPoolRewardVaultContract().enterCatostrophicFailure.getABIEncodedTransactionData();
|
||||
const txReceipt = await this._executeTransactionAsync(calldata, zeroExMultisigAddress);
|
||||
return txReceipt;
|
||||
}
|
||||
public async rewardVaultBalanceOfAsync(poolId: string): Promise<BigNumber> {
|
||||
const balance = await this.getRewardVaultContract().balanceOf.callAsync(poolId);
|
||||
const balance = await this.getStakingPoolRewardVaultContract().balanceOf.callAsync(poolId);
|
||||
return balance;
|
||||
}
|
||||
public async rewardVaultBalanceOfOperatorAsync(poolId: string): Promise<BigNumber> {
|
||||
const balance = await this.getRewardVaultContract().balanceOfOperator.callAsync(poolId);
|
||||
const balance = await this.getStakingPoolRewardVaultContract().balanceOfOperator.callAsync(poolId);
|
||||
return balance;
|
||||
}
|
||||
public async rewardVaultBalanceOfPoolAsync(poolId: string): Promise<BigNumber> {
|
||||
const balance = await this.getRewardVaultContract().balanceOfPool.callAsync(poolId);
|
||||
const balance = await this.getStakingPoolRewardVaultContract().balanceOfPool.callAsync(poolId);
|
||||
return balance;
|
||||
}
|
||||
public async rewardVaultCreatePoolAsync(
|
||||
@@ -629,7 +629,7 @@ export class StakingWrapper {
|
||||
poolOperatorShare: number,
|
||||
stakingContractAddress: string,
|
||||
): Promise<TransactionReceiptWithDecodedLogs> {
|
||||
const calldata = this.getRewardVaultContract().createPool.getABIEncodedTransactionData(
|
||||
const calldata = this.getStakingPoolRewardVaultContract().createPool.getABIEncodedTransactionData(
|
||||
poolId,
|
||||
poolOperatorShare,
|
||||
);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"generated-artifacts/LibFeeMathTest.json",
|
||||
"generated-artifacts/LibZrxToken.json",
|
||||
"generated-artifacts/MixinStake.json",
|
||||
"generated-artifacts/RewardVault.json",
|
||||
"generated-artifacts/Staking.json",
|
||||
"generated-artifacts/StakingPoolRewardVault.json",
|
||||
"generated-artifacts/StakingProxy.json",
|
||||
"generated-artifacts/ZrxVault.json"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user