Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tarot pools with 5x leverage #4675

Merged
merged 7 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 18 additions & 21 deletions src/components/scenes/Staking/StakeModifyScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,28 +391,25 @@ const StakeModifySceneComponent = (props: Props) => {
}

const renderWarning = () => {
// Warnings are only shown for single asset staking
let warningMessage = null
if (existingAllocations.staked.length === 1 && changeQuote !== null) {
const modStakedAmount =
changeQuoteAllocations.find(allocation => allocation.allocationType === 'stake' && gt(allocation.nativeAmount, '0'))?.nativeAmount || '0'
const stakedAmount = existingAllocations.staked[0]?.nativeAmount ?? '0'

const isRemainingStakedAmount = gt(stakedAmount, modStakedAmount)

if (modification === 'stake') {
if (stakeWarning === null) return null
warningMessage = stakeWarning ?? lstrings.stake_warning_stake
}
if (modification === 'claim') {
if (claimWarning === null) return null
warningMessage = claimWarning ?? lstrings.stake_warning_claim
}
if (modification === 'unstake') {
if (unstakeWarning === null) return null
warningMessage = unstakeWarning ?? isRemainingStakedAmount ? lstrings.stake_warning_unstake : null
}
let warningMessage: string | null = null

switch (modification) {
case 'stake':
if (stakeWarning == null) return null
warningMessage = stakeWarning
break
case 'claim':
if (claimWarning == null) return null
warningMessage = claimWarning
break
case 'unstake':
if (unstakeWarning == null) return null
warningMessage = unstakeWarning
break
default:
return null
samholmes marked this conversation as resolved.
Show resolved Hide resolved
}

return warningMessage == null ? null : (
<Alert marginRem={[0, 1, 1, 1]} title={lstrings.wc_smartcontract_warning_title} message={warningMessage} numberOfLines={0} type="warning" />
)
Expand Down
1 change: 1 addition & 0 deletions src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ const strings = {
stake_change_unstake_success: 'Funds successfully unstaked',
stake_change_claim_success: 'Claim transactions sent successfully',
stake_disabled_slider: 'Enter Amount',
stake_warning_multiple_transactions: 'Staking requires multiple transactions to confirm and may take 20 seconds or more to complete',
stake_warning_stake:
'Staking funds will block you from claiming rewards for 16 hours and withdrawing your staked funds for 36 hours.\n\nEvery interaction (stake, unstake, claim rewards) will reset both timers.',
stake_warning_claim:
Expand Down
1 change: 1 addition & 0 deletions src/locales/strings/enUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,7 @@
"stake_change_unstake_success": "Funds successfully unstaked",
"stake_change_claim_success": "Claim transactions sent successfully",
"stake_disabled_slider": "Enter Amount",
"stake_warning_multiple_transactions": "Staking requires multiple transactions to confirm and may take 20 seconds or more to complete",
"stake_warning_stake": "Staking funds will block you from claiming rewards for 16 hours and withdrawing your staked funds for 36 hours.\n\nEvery interaction (stake, unstake, claim rewards) will reset both timers.",
"stake_warning_claim": "Claiming rewards will block you from withdrawing your staked funds for 36 hours.\n\nTo claim rewards AND unstake any staked funds, choose “Claim Rewards and Unstake” instead.",
"stake_warning_unstake": "Unstaking a partial amount will block you from unstaking more funds for 36 hours.",
Expand Down
55 changes: 55 additions & 0 deletions src/plugins/abis/OptimismFeeOracle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
{
"inputs": [],
"name": "DECIMALS",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{ "inputs": [], "name": "baseFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" },
{
"inputs": [],
"name": "decimals",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "gasPrice",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes", "name": "_data", "type": "bytes" }],
"name": "getL1Fee",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "bytes", "name": "_data", "type": "bytes" }],
"name": "getL1GasUsed",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "l1BaseFee",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "overhead",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{ "inputs": [], "name": "scalar", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" },
{ "inputs": [], "name": "version", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }
]
Loading
Loading