Skip to content

Commit e8b2534

Browse files
hernandoagfadamgothtorhector2
authored
Check for presence of v1 delegate address (#959)
* Check v1 delegate first * Add additional delegate links (#957) * Add byteron link * PBG and UPMaker * Update Tenderly VDF v2 contract and use Tenderly SDK * Add test delegate migration * Add vigilant v2 contract * Use more consistent names (#960) --------- Co-authored-by: Adam Goth <[email protected]> Co-authored-by: Hector Rodriguez Fornies <[email protected]>
1 parent 13c1d6f commit e8b2534

File tree

7 files changed

+52
-9
lines changed

7 files changed

+52
-9
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"inputs":[{"internalType":"address","name":"_chief","type":"address"},{"internalType":"address","name":"_polling","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":true,"internalType":"address","name":"voteDelegate","type":"address"}],"name":"CreateVoteDelegate","type":"event"},{"inputs":[],"name":"chief","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"create","outputs":[{"internalType":"address","name":"voteDelegate","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"guy","type":"address"}],"name":"isDelegate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"polling","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

modules/contracts/eth-sdk.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ const config: EthSdkConfig = {
5454
pollingOld: '0xF9be8F0945acDdeeDaA64DFCA5Fe9629D0CF8E5D',
5555
pot: '0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7',
5656
vat: '0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B',
57-
voteDelegateFactory: '0xC3D809E87A2C9da4F6d98fECea9135d834d6F5A0',
57+
voteDelegateFactory: '0x093d305366218d6d09ba10448922f10814b031dd',
58+
voteDelegateFactoryOld: '0xD897F108670903D1d6070fcf818f9db3615AF272',
5859
voteProxyFactory: '0x6FCD258af181B3221073A96dD90D1f7AE7eEc408',
5960
voteProxyFactoryOld: '0xa63E145309cadaa6A903a19993868Ef7E85058BE',
6061
vow: '0xA950524441892A31ebddF91d3cEEFa04Bf454466'

modules/delegates/helpers/getDelegateContractAddress.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export async function getDelegateContractAddress(
1313
contracts: EthSdk,
1414
address: string
1515
): Promise<string | undefined> {
16-
const voteDelegateAdress = await contracts.voteDelegateFactory.delegates(address);
17-
return voteDelegateAdress !== ZERO_ADDRESS ? voteDelegateAdress : undefined;
16+
const voteDelegateAddress = await contracts.voteDelegateFactory.delegates(address);
17+
const voteDelegateAddressOld = await contracts.voteDelegateFactoryOld.delegates(address);
18+
return voteDelegateAddressOld !== ZERO_ADDRESS
19+
? voteDelegateAddressOld
20+
: voteDelegateAddress !== ZERO_ADDRESS
21+
? voteDelegateAddress
22+
: undefined;
1823
}

modules/migration/delegateAddressLinks.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const delegateAddressLinks = {
1212
// Format: Old Address -> new address
1313
[SupportedNetworks.TENDERLY]: {
1414
'0x3c85c3f4b0d610fd29cc132a2073f85c15f83f2b': '0xe5da2412d11200d478f77b0e881e7b5dbd190295',
15-
'0x3eB576f858B20085419Fd3f09DEE38E2cA372Cd6': '0x4C033196bbDfae26e186f32b058AEe7610a84171'
15+
'0x3eB576f858B20085419Fd3f09DEE38E2cA372Cd6': '0x4C033196bbDfae26e186f32b058AEe7610a84171',
16+
'0x008C9Ef7bEF55E6731eE5ce466b18eE99A6D3eeD': '0x932adcc9c79EdaC2bb5A98733Fe90e1f4e91E5e5'
1617
},
1718
[SupportedNetworks.MAINNET]: {
1819
// schuppi
@@ -72,7 +73,15 @@ export const delegateAddressLinks = {
7273
// QGov V2
7374
'0x4A92599433535b0E61d80085c5a90AeDf5a96467': '0x3B42d3C0F5c8f14A57C59f8BeA69b7cb02cEd1D5',
7475
// WBC V2
75-
'0x3C85C3F4B0d610Fd29cc132A2073f85C15F83f2b': '0x4C2134ABe86109dB784A5d0a34C98251Bb82a859'
76+
'0x3C85C3F4B0d610Fd29cc132A2073f85C15F83f2b': '0x4C2134ABe86109dB784A5d0a34C98251Bb82a859',
77+
// byteron V2
78+
'0x539400956A0B79963268fB7Ef4f95E9D618d58A6': '0x0f90ca538839d9354f987381bFc4151C4e0624B2',
79+
// PBG V2
80+
'0x51C659ee6FccebF7183da4E7D42A83b652F6E741': '0x1989BC38403A8c7f3c9A6699c5366d9AF6301dD6',
81+
// UPMaker V2
82+
'0x80ae9649fC445516f4792AF77b0B8F5809C38231': '0xB1b92313d93137E32FA2bE06455Cae5AEd78f33D',
83+
// vigilant V2
84+
'0x37D58532a985c2aD7a84EC61b0413Cc4B2c48977': '0xFE67Cbec68B6e00D9327B4ECf32C0d526b60668D'
7685
}
7786
};
7887

modules/tags/constants/poll-tags-mapping.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4579,5 +4579,32 @@
45794579
"1144": [
45804580
"high-impact",
45814581
"endgame"
4582+
],
4583+
"1145": [
4584+
"high-impact",
4585+
"collateral-onboard",
4586+
"spark"
4587+
],
4588+
"1146": [
4589+
"high-impact",
4590+
"collateral-onboard",
4591+
"spark"
4592+
],
4593+
"1147": [
4594+
"high-impact",
4595+
"oracle",
4596+
"spark"
4597+
],
4598+
"1148": [
4599+
"high-impact",
4600+
"endgame"
4601+
],
4602+
"1149": [
4603+
"high-impact",
4604+
"endgame"
4605+
],
4606+
"1150": [
4607+
"high-impact",
4608+
"endgame"
45824609
]
45834610
}

modules/web3/helpers/getContracts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
66
77
*/
88

9-
import { getMainnetSdk } from '@dethcrypto/eth-sdk-client';
9+
import { getMainnetSdk, getTenderlySdk } from '@dethcrypto/eth-sdk-client';
1010
import { providers } from 'ethers';
1111
import { CHAIN_INFO, DEFAULT_NETWORK } from '../constants/networks';
1212
import { SupportedChainId } from '../constants/chainID';
@@ -17,7 +17,7 @@ import { EthSdk, SdkGenerators } from '../types/contracts';
1717

1818
const sdkGenerators: SdkGenerators = {
1919
mainnet: getMainnetSdk,
20-
tenderly: getMainnetSdk
20+
tenderly: getTenderlySdk
2121
};
2222

2323
let connectedAccount: string | undefined;

modules/web3/helpers/getReadOnlyContracts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ SPDX-License-Identifier: AGPL-3.0-or-later
77
*/
88

99
import { providers } from 'ethers';
10-
import { getMainnetSdk } from '@dethcrypto/eth-sdk-client';
10+
import { getMainnetSdk, getTenderlySdk } from '@dethcrypto/eth-sdk-client';
1111
import { SupportedNetworks } from '../constants/networks';
1212
import { EthSdk, SdkGenerators } from '../types/contracts';
1313

1414
const sdkGenerators: SdkGenerators = {
1515
mainnet: getMainnetSdk,
16-
tenderly: getMainnetSdk
16+
tenderly: getTenderlySdk
1717
};
1818

1919
let currentNetwork: string | undefined;

0 commit comments

Comments
 (0)