Skip to content
10 changes: 4 additions & 6 deletions contracts/SimpleCollections.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,12 @@ contract SimpleCollections is ITokenURIDescriptor, OwnableUpgradeable {
return false;
}

// Always only allow staking via the SwapAndStake contract.
ISwapAndStake.Amounts memory stakeVia = swapAndStake.gatewayOf(
img.gateway
// Fetch the `amount of ETH` the `DEV staked` is equal to.
uint256 equivalentETHStaked = swapAndStake.getEstimatedEthForDev(
_positions.amount
);

// Validate the staking position.
bool valid = img.requiredETHAmount <= stakeVia.input &&
img.requiredETHFee <= stakeVia.fee;
bool valid = img.requiredETHAmount <= equivalentETHStaked;

if (valid) {
stakedAmountAtMinted[_positions.property][id] = _positions.amount;
Expand Down
4 changes: 4 additions & 0 deletions contracts/interfaces/ISwapAndStake.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ interface ISwapAndStake {
uint256 fee;
}

function getEstimatedEthForDev(
uint256 devAmount
) external returns (uint256);

function gatewayOf(address _addr) external view returns (Amounts memory);
}