Skip to content

Commit

Permalink
[station-score-if-badge, station-constant-if-badge, mangrove-station-…
Browse files Browse the repository at this point in the history
…qv-scaled-to-mgv] Update ERC-6551 ABI (snapshot-labs#1373)

* [station-score-if-badge, station-constant-if-badge, mangrove-station-qv-scaled-to-mgv] Update ERC-6551 ABI

The ordering of the ERC-6551 'account' function parameters has changed and the 'salt' is now a bytes32 instead of a uint256.
This commit updates the station-score-if-badge and its dependents station-constant-if-badge and mangrove-station-qv-scaled-to-mgv accordingly.

* chore: Fix linting error
  • Loading branch information
espendk authored Dec 17, 2023
1 parent d4eca95 commit 215c357
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 55 deletions.
27 changes: 13 additions & 14 deletions src/strategies/mangrove-station-qv-scaled-to-mgv/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,25 @@
"strategy": {
"name": "mangrove-station-qv-scaled-to-mgv",
"params": {
"membershipERC721": "0xd71c8619209cc95a81f8d9ba4fd704d9eff3ddd6",
"badgesERC1155": "0xd775e55e314164cce7f71f9f70fc905c907fc65e",
"membershipERC721": "0x33dbde2e093b7cf8446d9ac0de79220d42423501",
"badgesERC1155": "0xd1502a7659eaad60278ae3ef27edea849504f4da",
"activeBadgeId": 1,
"activityScoreERC20": "0x30D602cBfe96FC2C83fF31Bdf79d48De65f80733",
"activityScoreERC20": "0x5f120453dfd0c55f55370d1f718089ae0fcf6387",
"activityScoreDecimals": 18,
"erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921",
"erc6551Implementation": "0x2d25602551487c3f3354dd80d76d54383a243358",
"erc6551Salt": 0,
"dssVestAddress": "0xc67A1EB2BD5794C070cC555fD4533CF8E28E7162",
"erc6551Registry": "0x000000006551c19487814612e58FE06813775758",
"erc6551Implementation": "0x509b531c8e979c85375370c0ba92ac44173c2d12",
"erc6551Salt": "0x0000000000000000000000000000000000000000000000000000000000000000",
"dssVestAddress": "0x370F850180FDDCdc521Ed11900a7a27D08B2d402",
"dssVestDecimals": 18
}
},
"network": "5",
"network": "1",
"addresses": [
"0x4D7f3AEA074C6e8136C7e81ff8Af8BccdA3a7d89",
"0x4B977dC5bF15eC7FB9B2062CA15092B99d13b8F1",
"0xf78E7a442ea032a4D30FBA984c16a73Af5C915a0",
"0xAa01DeC5307CF17F20881A3286dcaA062578cea7",
"0xCD252d6AB26b7363E75d7451029C0f0729783AcE"
"0x5A8CA059a7e185ad01695136dbe5A721D4e053D6",
"0x1ba671ce4718d76D42609affbB567Bf1E71E0852",
"0x008B1FFe244bF31896C833bFf4Ad9009E7A0f4Eb",
"0x1b515D521dd0CBA174Bee666ED8f42449C8cA8bb"
],
"snapshot": 9855099
"snapshot": 18779365
}
]
2 changes: 1 addition & 1 deletion src/strategies/mangrove-station-qv-scaled-to-mgv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { getAllVestings } from '../dss-vest-unpaid';

export const author = 'espendk';
export const version = '1.0.0';
export const version = '1.0.1';

export async function strategy(
space,
Expand Down
10 changes: 7 additions & 3 deletions src/strategies/mangrove-station-qv-scaled-to-mgv/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@
"maxLength": 42
},
"erc6551Salt": {
"type": "number",
"type": "string",
"title": "ERC6551 salt",
"examples": ["e.g. 0"],
"minimum": 0
"examples": [
"e.g. 0x0000000000000000000000000000000000000000000000000000000000000000"
],
"pattern": "^0x[a-fA-F0-9]{64}$",
"minLength": 66,
"maxLength": 66
},
"dssVestAddress": {
"type": "string",
Expand Down
23 changes: 11 additions & 12 deletions src/strategies/station-constant-if-badge/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
"strategy": {
"name": "station-constant-if-badge",
"params": {
"membershipERC721": "0xd71c8619209cc95a81f8d9ba4fd704d9eff3ddd6",
"badgesERC1155": "0xd775e55e314164cce7f71f9f70fc905c907fc65e",
"membershipERC721": "0x33dbde2e093b7cf8446d9ac0de79220d42423501",
"badgesERC1155": "0xd1502a7659eaad60278ae3ef27edea849504f4da",
"badgeId": 1,
"constant": 1337,
"erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921",
"erc6551Implementation": "0x2d25602551487c3f3354dd80d76d54383a243358",
"erc6551Salt": 0
"erc6551Registry": "0x000000006551c19487814612e58FE06813775758",
"erc6551Implementation": "0x509b531c8e979c85375370c0ba92ac44173c2d12",
"erc6551Salt": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"network": "5",
"network": "1",
"addresses": [
"0x4D7f3AEA074C6e8136C7e81ff8Af8BccdA3a7d89",
"0x4B977dC5bF15eC7FB9B2062CA15092B99d13b8F1",
"0xf78E7a442ea032a4D30FBA984c16a73Af5C915a0",
"0xAa01DeC5307CF17F20881A3286dcaA062578cea7",
"0xCD252d6AB26b7363E75d7451029C0f0729783AcE"
"0x5A8CA059a7e185ad01695136dbe5A721D4e053D6",
"0x1ba671ce4718d76D42609affbB567Bf1E71E0852",
"0x008B1FFe244bF31896C833bFf4Ad9009E7A0f4Eb",
"0x1b515D521dd0CBA174Bee666ED8f42449C8cA8bb"
],
"snapshot": 9852748
"snapshot": 18779365
}
]
2 changes: 1 addition & 1 deletion src/strategies/station-constant-if-badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '../station-score-if-badge';

export const author = 'espendk';
export const version = '1.0.0';
export const version = '1.0.1';

export async function strategy(
space,
Expand Down
10 changes: 7 additions & 3 deletions src/strategies/station-constant-if-badge/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@
"maxLength": 42
},
"erc6551Salt": {
"type": "number",
"type": "string",
"title": "ERC6551 salt",
"examples": ["e.g. 0"],
"minimum": 0
"examples": [
"e.g. 0x0000000000000000000000000000000000000000000000000000000000000000"
],
"pattern": "^0x[a-fA-F0-9]{64}$",
"minLength": 66,
"maxLength": 66
}
},
"required": [],
Expand Down
25 changes: 12 additions & 13 deletions src/strategies/station-score-if-badge/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,23 @@
"strategy": {
"name": "station-score-if-badge",
"params": {
"membershipERC721": "0xd71c8619209cc95a81f8d9ba4fd704d9eff3ddd6",
"badgesERC1155": "0xd775e55e314164cce7f71f9f70fc905c907fc65e",
"membershipERC721": "0x33dbde2e093b7cf8446d9ac0de79220d42423501",
"badgesERC1155": "0xd1502a7659eaad60278ae3ef27edea849504f4da",
"badgeId": 1,
"scoreERC20": "0x30D602cBfe96FC2C83fF31Bdf79d48De65f80733",
"scoreERC20": "0x5f120453dfd0c55f55370d1f718089ae0fcf6387",
"scoreDecimals": 18,
"erc6551Registry": "0x02101dfB77FDE026414827Fdc604ddAF224F0921",
"erc6551Implementation": "0x2d25602551487c3f3354dd80d76d54383a243358",
"erc6551Salt": 0
"erc6551Registry": "0x000000006551c19487814612e58FE06813775758",
"erc6551Implementation": "0x509b531c8e979c85375370c0ba92ac44173c2d12",
"erc6551Salt": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"network": "5",
"network": "1",
"addresses": [
"0x4D7f3AEA074C6e8136C7e81ff8Af8BccdA3a7d89",
"0x4B977dC5bF15eC7FB9B2062CA15092B99d13b8F1",
"0xf78E7a442ea032a4D30FBA984c16a73Af5C915a0",
"0xAa01DeC5307CF17F20881A3286dcaA062578cea7",
"0xCD252d6AB26b7363E75d7451029C0f0729783AcE"
"0x5A8CA059a7e185ad01695136dbe5A721D4e053D6",
"0x1ba671ce4718d76D42609affbB567Bf1E71E0852",
"0x008B1FFe244bF31896C833bFf4Ad9009E7A0f4Eb",
"0x1b515D521dd0CBA174Bee666ED8f42449C8cA8bb"
],
"snapshot": 9852748
"snapshot": 18779365
}
]
10 changes: 5 additions & 5 deletions src/strategies/station-score-if-badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Contract } from '@ethersproject/contracts';
import { Multicaller } from '../../utils';

export const author = 'espendk';
export const version = '1.0.0';
export const version = '1.0.1';

// To avoid future memory issues, we limit the number of members supported by the strategy
export const MAX_MEMBERS = 500;
Expand All @@ -15,7 +15,7 @@ export const erc721_abi = [
];

export const erc6551_registry_abi = [
'function account(address implementation, uint256 chainId, address tokenContract, uint256 tokenId, uint256 salt) external view returns (address)'
'function account(address implementation, bytes32 salt, uint256 chainId, address tokenContract, uint256 tokenId) external view returns (address)'
];

export const erc1155_abi = [
Expand Down Expand Up @@ -51,7 +51,7 @@ export async function getAllMembers(
membershipERC721: string,
erc6551Registry: string,
erc6551Implementation: string,
erc6551Salt: number
erc6551Salt: string
): Promise<Map<string, Member>> {
const blockTag = typeof snapshot === 'number' ? snapshot : 'latest';

Expand Down Expand Up @@ -86,10 +86,10 @@ export async function getAllMembers(
membershipERC721Multicaller.call(id, membershipERC721, 'ownerOf', [id]);
erc6551RegistryMulticaller.call(id, erc6551Registry, 'account', [
erc6551Implementation,
erc6551Salt,
network,
membershipERC721,
id,
erc6551Salt
id
]);
}

Expand Down
10 changes: 7 additions & 3 deletions src/strategies/station-score-if-badge/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@
"maxLength": 42
},
"erc6551Salt": {
"type": "number",
"type": "string",
"title": "ERC6551 salt",
"examples": ["e.g. 0"],
"minimum": 0
"examples": [
"e.g. 0x0000000000000000000000000000000000000000000000000000000000000000"
],
"pattern": "^0x[a-fA-F0-9]{64}$",
"minLength": 66,
"maxLength": 66
}
},
"required": [],
Expand Down

0 comments on commit 215c357

Please sign in to comment.