@@ -24,7 +24,7 @@ interface DecodedData {
24
24
25
25
const ATTESTATION_SCHEMA_UID = `0x1289c5f988998891af7416d83820c40ba1c6f5ba31467f2e611172334dc53a0e`
26
26
const SMART_INVOICE_MULTISIG = `0x503a5161D1c5D9d82BF35a4c80DA0C3Ad72d9244` // TODO: replace with actual multisig address
27
- const BUILDER_DAO_TREASURY = `0xcf325a4c78912216249b818521b0798a0f904c10`
27
+ const BUILDER_DAO_TREASURY = `0xcf325a4c78912216249b818521b0798a0f904c10`
28
28
const BUILDER_DAO_OPS_MULTISIG = `0x58eAEfBEd9EEFbC564E302D0AfAE0B113E42eAb3`
29
29
30
30
const ATTESTATION_URL : Record < CHAIN_ID , string > = {
@@ -39,7 +39,7 @@ const ATTESTATION_URL: Record<CHAIN_ID, string> = {
39
39
[ CHAIN_ID . FOUNDRY ] : '' ,
40
40
}
41
41
42
- export async function getDaoMultiSig (
42
+ export async function getEscrowDelegate (
43
43
daoTreasuryAddress : string ,
44
44
chainId : CHAIN_ID
45
45
) : Promise < string | null > {
@@ -53,20 +53,19 @@ export async function getDaoMultiSig(
53
53
return null
54
54
}
55
55
56
- const multiSigIssuerPriorityOrder = [
56
+ const attestationIssuerPriorityOrder = [
57
57
checksumAddress ( daoTreasuryAddress ) ,
58
58
checksumAddress ( BUILDER_DAO_TREASURY ) ,
59
- checksumAddress ( BUILDER_DAO_OPS_MULTISIG ) ,
60
- checksumAddress ( SMART_INVOICE_MULTISIG )
61
- ] ;
62
-
59
+ checksumAddress ( BUILDER_DAO_OPS_MULTISIG ) ,
60
+ checksumAddress ( SMART_INVOICE_MULTISIG ) ,
61
+ ]
63
62
64
63
const query = `
65
64
query Attestations {
66
65
attestations(
67
66
where: {
68
67
schemaId: { equals: "${ ATTESTATION_SCHEMA_UID } " }
69
- attester: { in: ["${ multiSigIssuerPriorityOrder . join ( '","' ) } "] }
68
+ attester: { in: ["${ attestationIssuerPriorityOrder . join ( '","' ) } "] }
70
69
recipient: { equals: "${ checksumAddress ( daoTreasuryAddress ) } " }
71
70
}
72
71
) {
@@ -77,7 +76,6 @@ export async function getDaoMultiSig(
77
76
}
78
77
`
79
78
80
-
81
79
try {
82
80
const response = await axios . post < AttestationResponse > (
83
81
attestationUrl ,
@@ -91,11 +89,10 @@ export async function getDaoMultiSig(
91
89
92
90
const attestations = response ?. data ?. data ?. attestations
93
91
94
-
95
92
// Sort attestations based on priority order
96
93
const sortedAttestations = attestations . sort ( ( a , b ) => {
97
- const indexA = multiSigIssuerPriorityOrder . indexOf ( a . attester as `0x${string } `)
98
- const indexB = multiSigIssuerPriorityOrder . indexOf ( b . attester as `0x${string } `)
94
+ const indexA = attestationIssuerPriorityOrder . indexOf ( a . attester as `0x${string } `)
95
+ const indexB = attestationIssuerPriorityOrder . indexOf ( b . attester as `0x${string } `)
99
96
return indexA - indexB
100
97
} )
101
98
@@ -105,14 +102,16 @@ export async function getDaoMultiSig(
105
102
106
103
try {
107
104
// Get the first attestation from priority
108
- const decodedData = JSON . parse ( sortedAttestations [ 0 ] . decodedDataJson ) as DecodedData [ ]
105
+ const decodedData = JSON . parse (
106
+ sortedAttestations [ 0 ] . decodedDataJson
107
+ ) as DecodedData [ ]
109
108
110
- const multisigAddress = decodedData [ 0 ] ?. value ?. value
111
- if ( ! multisigAddress || ! isAddress ( multisigAddress ) ) {
109
+ const escrowDelegateAddress = decodedData [ 0 ] ?. value ?. value
110
+ if ( ! escrowDelegateAddress || ! isAddress ( escrowDelegateAddress ) ) {
112
111
return null
113
112
}
114
113
115
- return multisigAddress
114
+ return escrowDelegateAddress
116
115
} catch ( parseError ) {
117
116
console . error ( 'Error parsing attestation data:' , parseError )
118
117
return null
0 commit comments