Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Change contract #2210

Merged
merged 3 commits into from
Jan 19, 2022
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
22 changes: 14 additions & 8 deletions src/custom/abis/types/VCow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface VCowInterface extends ethers.utils.Interface {
"deploymentTimestamp()": FunctionFragment;
"gnoPrice()": FunctionFragment;
"usdcPrice()": FunctionFragment;
"wethPrice()": FunctionFragment;
"nativeTokenPrice()": FunctionFragment;
};

encodeFunctionData(
Expand Down Expand Up @@ -68,7 +68,10 @@ interface VCowInterface extends ethers.utils.Interface {
): string;
encodeFunctionData(functionFragment: "gnoPrice", values?: undefined): string;
encodeFunctionData(functionFragment: "usdcPrice", values?: undefined): string;
encodeFunctionData(functionFragment: "wethPrice", values?: undefined): string;
encodeFunctionData(
functionFragment: "nativeTokenPrice",
values?: undefined
): string;

decodeFunctionResult(functionFragment: "claim", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "claimMany", data: BytesLike): Result;
Expand All @@ -80,7 +83,10 @@ interface VCowInterface extends ethers.utils.Interface {
): Result;
decodeFunctionResult(functionFragment: "gnoPrice", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "usdcPrice", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "wethPrice", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "nativeTokenPrice",
data: BytesLike
): Result;

events: {
"Claimed(uint256,uint8,address,uint256,uint256)": EventFragment;
Expand Down Expand Up @@ -177,7 +183,7 @@ export class VCow extends BaseContract {

usdcPrice(overrides?: CallOverrides): Promise<[BigNumber]>;

wethPrice(overrides?: CallOverrides): Promise<[BigNumber]>;
nativeTokenPrice(overrides?: CallOverrides): Promise<[BigNumber]>;
};

claim(
Expand Down Expand Up @@ -211,7 +217,7 @@ export class VCow extends BaseContract {

usdcPrice(overrides?: CallOverrides): Promise<BigNumber>;

wethPrice(overrides?: CallOverrides): Promise<BigNumber>;
nativeTokenPrice(overrides?: CallOverrides): Promise<BigNumber>;

callStatic: {
claim(
Expand Down Expand Up @@ -245,7 +251,7 @@ export class VCow extends BaseContract {

usdcPrice(overrides?: CallOverrides): Promise<BigNumber>;

wethPrice(overrides?: CallOverrides): Promise<BigNumber>;
nativeTokenPrice(overrides?: CallOverrides): Promise<BigNumber>;
};

filters: {
Expand Down Expand Up @@ -319,7 +325,7 @@ export class VCow extends BaseContract {

usdcPrice(overrides?: CallOverrides): Promise<BigNumber>;

wethPrice(overrides?: CallOverrides): Promise<BigNumber>;
nativeTokenPrice(overrides?: CallOverrides): Promise<BigNumber>;
};

populateTransaction: {
Expand Down Expand Up @@ -359,6 +365,6 @@ export class VCow extends BaseContract {

usdcPrice(overrides?: CallOverrides): Promise<PopulatedTransaction>;

wethPrice(overrides?: CallOverrides): Promise<PopulatedTransaction>;
nativeTokenPrice(overrides?: CallOverrides): Promise<PopulatedTransaction>;
};
}
2 changes: 1 addition & 1 deletion src/custom/abis/types/factories/VCow__factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const _abi = [
},
{
inputs: [],
name: "wethPrice",
name: "nativeTokenPrice",
outputs: [
{
internalType: "uint256",
Expand Down
2 changes: 1 addition & 1 deletion src/custom/abis/vCow.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
},
{
"inputs": [],
"name": "wethPrice",
"name": "nativeTokenPrice",
"outputs": [
{
"internalType": "uint256",
Expand Down
2 changes: 1 addition & 1 deletion src/custom/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const V_COW_CONTRACT_ADDRESS: Partial<Record<number, string>> = {
// [ChainId.MAINNET]: GPv2Settlement[ChainId.MAINNET].address,
// [ChainId.RINKEBY]: GPv2Settlement[ChainId.RINKEBY].address,
// [ChainId.XDAI]: GPv2Settlement[ChainId.XDAI].address,
[ChainId.RINKEBY]: '0x71A377EC0026A8E35AfD082d54E2f62d39AF075c',
[ChainId.RINKEBY]: '0xB26D8c5D3d0A67F419F7b314D462C8357Cd4b122',
}

// See https://github.com/gnosis/gp-v2-contracts/commit/821b5a8da213297b0f7f1d8b17c893c5627020af#diff-12bbbe13cd5cf42d639e34a39d8795021ba40d3ee1e1a8282df652eb161a11d6R13
Expand Down
6 changes: 2 additions & 4 deletions src/custom/state/claim/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ export function useClaimTimeInfo(): ClaimTimeInfo {
}

export function useNativeTokenPrice(): string | null {
// TODO: rename fn to `nativeTokenPrice` and revert e7197dd27287ff1460a7d7af22734cae938b8c83
// when there's a new deployment
return _useVCowPriceForToken('wethPrice')
return _useVCowPriceForToken('nativeTokenPrice')
}

export function useGnoPrice(): string | null {
Expand All @@ -344,7 +342,7 @@ export function useUsdcPrice(): string | null {
return _useVCowPriceForToken('usdcPrice')
}

type VCowPriceFnNames = 'wethPrice' | 'gnoPrice' | 'usdcPrice'
type VCowPriceFnNames = 'nativeTokenPrice' | 'gnoPrice' | 'usdcPrice'

/**
* Generic hook for fetching contract value for the many prices
Expand Down