Skip to content

Commit

Permalink
feat: update WOUSD and WOETH symbol casing
Browse files Browse the repository at this point in the history
  • Loading branch information
toniocodo committed Nov 7, 2023
1 parent bcd626d commit d3fe3ed
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion apps/oeth/src/components/Topnav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function Topnav(props: BoxProps) {
setAnchor={setAccountModalAnchor}
balanceTokens={[
tokens.mainnet.OETH,
tokens.mainnet.WOETH,
tokens.mainnet.wOETH,
tokens.mainnet.WETH,
tokens.mainnet.rETH,
tokens.mainnet.frxETH,
Expand Down
2 changes: 1 addition & 1 deletion apps/ousd/src/components/Topnav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function Topnav(props: BoxProps) {
setAnchor={setAccountModalAnchor}
balanceTokens={[
tokens.mainnet.OUSD,
tokens.mainnet.WOUSD,
tokens.mainnet.wOUSD,
tokens.mainnet.USDT,
tokens.mainnet.DAI,
tokens.mainnet.USDC,
Expand Down
26 changes: 13 additions & 13 deletions libs/oeth/swap/src/actions/unwrapWOETH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const estimateAmount: EstimateAmount = async ({ amountIn }) => {
}

const data = await readContract({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'convertToAssets',
args: [amountIn],
});
Expand All @@ -48,8 +48,8 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {
if (!isNilOrEmpty(address)) {
try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'redeem',
args: [amountIn, address, address],
account: address,
Expand All @@ -61,11 +61,11 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {

try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'redeem',
args: [amountIn, whales.mainnet.WOETH, whales.mainnet.WOETH],
account: whales.mainnet.WOETH,
args: [amountIn, whales.mainnet.wOETH, whales.mainnet.wOETH],
account: whales.mainnet.wOETH,
});
} catch {
gasEstimate = 21000n;
Expand All @@ -75,12 +75,12 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {
};

const allowance: Allowance = async () => {
// Unwrap WOETH does not require approval
// Unwrap wOETH does not require approval
return maxUint256;
};

const estimateApprovalGas: EstimateApprovalGas = async () => {
// Unwrap WOETH does not require approval
// Unwrap wOETH does not require approval
return 0n;
};

Expand Down Expand Up @@ -123,7 +123,7 @@ const estimateRoute: EstimateRoute = async ({
};

const approve: Approve = async () => {
// Unwrap WOETH does not require approval
// Unwrap wOETH does not require approval
return null;
};

Expand All @@ -135,8 +135,8 @@ const swap: Swap = async ({ amountIn }) => {
}

const { request } = await prepareWriteContract({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'redeem',
args: [amountIn, address, address],
});
Expand Down
22 changes: 11 additions & 11 deletions libs/oeth/swap/src/actions/wrapOETH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const estimateAmount: EstimateAmount = async ({ amountIn }) => {
}

const data = await readContract({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'convertToShares',
args: [amountIn],
});
Expand All @@ -49,8 +49,8 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {
if (!isNilOrEmpty(address)) {
try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'deposit',
args: [amountIn, address],
account: address,
Expand All @@ -62,8 +62,8 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {

try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'deposit',
args: [amountIn, whales.mainnet.OETH],
account: whales.mainnet.OETH,
Expand All @@ -86,7 +86,7 @@ const allowance: Allowance = async ({ tokenIn }) => {
address: tokenIn.address,
abi: erc20ABI,
functionName: 'allowance',
args: [address, tokens.mainnet.WOETH.address],
args: [address, tokens.mainnet.wOETH.address],
});

return allowance;
Expand All @@ -110,7 +110,7 @@ const estimateApprovalGas: EstimateApprovalGas = async ({
address: tokenIn.address,
abi: erc20ABI,
functionName: 'approve',
args: [tokens.mainnet.WOETH.address, amountIn],
args: [tokens.mainnet.wOETH.address, amountIn],
account: address,
});
} catch {
Expand Down Expand Up @@ -163,7 +163,7 @@ const approve: Approve = async ({ tokenIn, tokenOut, amountIn, curve }) => {
address: tokenIn.address,
abi: erc20ABI,
functionName: 'approve',
args: [tokens.mainnet.WOETH.address, amountIn],
args: [tokens.mainnet.wOETH.address, amountIn],
});
const { hash } = await writeContract(request);

Expand All @@ -184,8 +184,8 @@ const swap: Swap = async ({ tokenIn, tokenOut, amountIn }) => {
}

const { request } = await prepareWriteContract({
address: tokens.mainnet.WOETH.address,
abi: tokens.mainnet.WOETH.abi,
address: tokens.mainnet.wOETH.address,
abi: tokens.mainnet.wOETH.abi,
functionName: 'deposit',
args: [amountIn, address],
});
Expand Down
4 changes: 2 additions & 2 deletions libs/oeth/swap/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ export const swapRoutes: SwapRoute<SwapAction>[] = [
// Wrap
{
tokenIn: tokens.mainnet.OETH,
tokenOut: tokens.mainnet.WOETH,
tokenOut: tokens.mainnet.wOETH,
action: 'wrap-oeth',
},
// Unwrap
{
tokenIn: tokens.mainnet.WOETH,
tokenIn: tokens.mainnet.wOETH,
tokenOut: tokens.mainnet.OETH,
action: 'unwrap-woeth',
},
Expand Down
26 changes: 13 additions & 13 deletions libs/ousd/swap/src/actions/unwrapWOUSD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const estimateAmount: EstimateAmount = async ({ amountIn }) => {
}

const data = await readContract({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'convertToAssets',
args: [amountIn],
});
Expand All @@ -48,8 +48,8 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {
if (!isNilOrEmpty(address)) {
try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'redeem',
args: [amountIn, address, address],
account: address,
Expand All @@ -61,11 +61,11 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {

try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'redeem',
args: [amountIn, whales.mainnet.WOUSD, whales.mainnet.WOUSD],
account: whales.mainnet.WOUSD,
args: [amountIn, whales.mainnet.wOUSD, whales.mainnet.wOUSD],
account: whales.mainnet.wOUSD,
});
} catch {
gasEstimate = 21000n;
Expand All @@ -75,12 +75,12 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {
};

const allowance: Allowance = async () => {
// Unwrap WOUSD does not require approval
// Unwrap wOUSD does not require approval
return maxUint256;
};

const estimateApprovalGas: EstimateApprovalGas = async () => {
// Unwrap WOUSD does not require approval
// Unwrap wOUSD does not require approval
return 0n;
};

Expand Down Expand Up @@ -123,7 +123,7 @@ const estimateRoute: EstimateRoute = async ({
};

const approve: Approve = async () => {
// Unwrap WOUSD does not require approval
// Unwrap wOUSD does not require approval
return null;
};

Expand All @@ -135,8 +135,8 @@ const swap: Swap = async ({ amountIn }) => {
}

const { request } = await prepareWriteContract({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'redeem',
args: [amountIn, address, address],
});
Expand Down
24 changes: 12 additions & 12 deletions libs/ousd/swap/src/actions/wrapOUSD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const estimateAmount: EstimateAmount = async ({ amountIn }) => {
}

const data = await readContract({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'convertToShares',
args: [amountIn],
});
Expand All @@ -49,8 +49,8 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {
if (!isNilOrEmpty(address)) {
try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'deposit',
args: [amountIn, address],
account: address,
Expand All @@ -62,8 +62,8 @@ const estimateGas: EstimateGas = async ({ amountIn }) => {

try {
gasEstimate = await publicClient.estimateContractGas({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'deposit',
args: [amountIn, whales.mainnet.OETH],
account: whales.mainnet.OETH,
Expand All @@ -86,7 +86,7 @@ const allowance: Allowance = async ({ tokenIn }) => {
address: tokenIn.address,
abi: tokenIn.abi,
functionName: 'allowance',
args: [address, tokens.mainnet.WOUSD.address],
args: [address, tokens.mainnet.wOUSD.address],
});

return allowance as unknown as bigint;
Expand All @@ -110,7 +110,7 @@ const estimateApprovalGas: EstimateApprovalGas = async ({
address: tokenIn.address,
abi: erc20ABI,
functionName: 'approve',
args: [tokens.mainnet.WOUSD.address, amountIn],
args: [tokens.mainnet.wOUSD.address, amountIn],
account: address,
});
} catch {
Expand Down Expand Up @@ -163,7 +163,7 @@ const approve: Approve = async ({ tokenIn, tokenOut, amountIn, curve }) => {
address: tokenIn.address,
abi: tokenIn.abi,
functionName: 'approve',
args: [tokens.mainnet.WOUSD.address, amountIn],
args: [tokens.mainnet.wOUSD.address, amountIn],
});
const { hash } = await writeContract(request);

Expand All @@ -180,12 +180,12 @@ const swap: Swap = async ({ tokenIn, tokenOut, amountIn }) => {
const approved = await allowance({ tokenIn, tokenOut });

if (approved < amountIn) {
throw new Error(`WOUSD is not approved`);
throw new Error(`wOUSD is not approved`);
}

const { request } = await prepareWriteContract({
address: tokens.mainnet.WOUSD.address,
abi: tokens.mainnet.WOUSD.abi,
address: tokens.mainnet.wOUSD.address,
abi: tokens.mainnet.wOUSD.abi,
functionName: 'deposit',
args: [amountIn, address],
});
Expand Down
6 changes: 3 additions & 3 deletions libs/ousd/swap/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ export const swapRoutes: SwapRoute<SwapAction>[] = [
// Wrap OUSD
{
tokenIn: tokens.mainnet.OUSD,
tokenOut: tokens.mainnet.WOUSD,
tokenOut: tokens.mainnet.wOUSD,
action: 'wrap-ousd',
},
// Unwrap WOUSD
// Unwrap wOUSD
{
tokenIn: tokens.mainnet.WOUSD,
tokenIn: tokens.mainnet.wOUSD,
tokenOut: tokens.mainnet.OUSD,
action: 'unwrap-wousd',
},
Expand Down
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion libs/shared/contracts/src/network.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -26944,7 +26944,7 @@
}
]
},
"WOETH": {
"wOETH": {
"address": "0x9C5a92AaA2A4373D6bd20F7b45cdEb7A13f9AA79",
"abi": [
{
Expand Down
12 changes: 6 additions & 6 deletions libs/shared/contracts/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,23 @@ export const tokens = {
decimals: 18,
symbol: 'WETH',
},
WOETH: {
wOETH: {
address: '0xDcEe70654261AF21C44c093C300eD3Bb97b78192',
chainId: mainnet.id,
abi: WOETHABI,
name: 'Wrapped Origin Ether',
icon: '/images/tokens/WOETH.svg',
icon: '/images/tokens/wOETH.svg',
decimals: 18,
symbol: 'WOETH',
symbol: 'wOETH',
},
WOUSD: {
wOUSD: {
address: '0xD2af830E8CBdFed6CC11Bab697bB25496ed6FA62',
chainId: mainnet.id,
abi: WrappedOusdABI,
name: 'WrappedOrigin Dollar',
icon: '/images/tokens/WOUSD.svg',
icon: '/images/tokens/wOUSD.svg',
decimals: 18,
symbol: 'WOUSD',
symbol: 'wOUSD',
},
},
} as const;
4 changes: 2 additions & 2 deletions libs/shared/contracts/src/whales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
export const whales = {
mainnet: {
OETH: '0x94B17476A93b3262d87B9a326965D1E91f9c13E7',
WOETH: '0xC460B0b6c9b578A4Cb93F99A691e16dB96Ee5833',
wOETH: '0xC460B0b6c9b578A4Cb93F99A691e16dB96Ee5833',
OUSD: '0x70fCE97d671E81080CA3ab4cc7A59aAc2E117137',
WOUSD: '0x3dD413Fd4D03b1d8fD2C9Ed34553F7DeC3B26F5C',
wOUSD: '0x3dD413Fd4D03b1d8fD2C9Ed34553F7DeC3B26F5C',
},
} as const;
Loading

0 comments on commit d3fe3ed

Please sign in to comment.