File tree Expand file tree Collapse file tree 5 files changed +152
-4
lines changed
contracts/baseDAO/lambdaDAO
michelson/supported_lambda_types
services/dao/mappers/proposal Expand file tree Collapse file tree 5 files changed +152
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import { ActionSheetProvider } from "modules/explorer/context/ActionSheets"
2020import { legacyTheme } from "theme/legacy"
2121import { Footer } from "modules/common/Footer"
2222import { FAQ } from "modules/home/FAQ"
23- import { EnvKey , getEnv } from "services/config"
23+ import { EnvKey , HUMANITEZ_DAO , getEnv } from "services/config"
2424import { DAOCreatorRouter } from "modules/creator/router"
2525import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"
2626import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"
@@ -124,7 +124,7 @@ const App: React.FC = () => {
124124 < DAOExplorerRouter />
125125 </ TZKTSubscriptionsProvider >
126126
127- { window . location . href . indexOf ( "KT1PY9PXm8NMAgSEZg7bUtFjmV2Sj64bKuVV" ) !== - 1 ? (
127+ { window . location . href . indexOf ( HUMANITEZ_DAO ) !== - 1 ? (
128128 < >
129129 { /* Special case for this DAO which was created before FA1.2 fix was created for the smart contract */ }
130130 < WarningFooter
Original file line number Diff line number Diff line change @@ -21,3 +21,5 @@ export enum EnvKey {
2121export enum FeatureFlag {
2222 lambdaDao = "lambdaDao"
2323}
24+
25+ export const HUMANITEZ_DAO = "KT1PY9PXm8NMAgSEZg7bUtFjmV2Sj64bKuVV"
Original file line number Diff line number Diff line change @@ -13,9 +13,11 @@ import { formatUnits } from "../../utils"
1313import { LambdaAddArgs , LambdaExecuteArgs , LambdaRemoveArgs } from "./types"
1414
1515import transfer_arg_type_michelson from "./michelson/supported_lambda_types/transfer_proposal_type.json"
16+ import transfer_proposal_type_before_fa12 from "./michelson/supported_lambda_types/transfer_proposal_type_before_fa1.2.json"
1617import update_contract_delegate_type_michelson from "./michelson/supported_lambda_types/update_contract_delegate_proposal.json"
1718import update_guardian_type_michelson from "./michelson/supported_lambda_types/update_guardian_proposal.json"
1819import { Community } from "models/Community"
20+ import { HUMANITEZ_DAO } from "services/config"
1921
2022const parser = new Parser ( )
2123
@@ -162,7 +164,10 @@ export class LambdaDAO extends BaseDAO {
162164 const contract = await getContract ( tezos , this . data . address )
163165 const p = new Parser ( )
164166
165- const transfer_arg_schema = new Schema ( transfer_arg_type_michelson as MichelsonData )
167+ const transfer_michelson =
168+ this . data . address === HUMANITEZ_DAO ? transfer_proposal_type_before_fa12 : transfer_arg_type_michelson
169+
170+ const transfer_arg_schema = new Schema ( transfer_michelson as MichelsonData )
166171 const transfer_proposal_args = {
167172 transfers : mapTransfersArgs ( transfer_proposal . transfers , this . data . address ) ,
168173 registry_diff : transfer_proposal . registry_diff . map ( item => [ char2Bytes ( item . key ) , char2Bytes ( item . value ) ] ) ,
Original file line number Diff line number Diff line change 1+ {
2+ "prim" : " pair" ,
3+ "args" : [
4+ {
5+ "prim" : " pair" ,
6+ "args" : [
7+ {
8+ "prim" : " nat" ,
9+ "annots" : [
10+ " %agora_post_id"
11+ ]
12+ },
13+ {
14+ "prim" : " list" ,
15+ "annots" : [
16+ " %registry_diff"
17+ ],
18+ "args" : [
19+ {
20+ "prim" : " pair" ,
21+ "args" : [
22+ {
23+ "prim" : " string"
24+ },
25+ {
26+ "prim" : " option" ,
27+ "args" : [
28+ {
29+ "prim" : " string"
30+ }
31+ ]
32+ }
33+ ]
34+ }
35+ ]
36+ }
37+ ]
38+ },
39+ {
40+ "prim" : " list" ,
41+ "annots" : [
42+ " %transfers"
43+ ],
44+ "args" : [
45+ {
46+ "prim" : " or" ,
47+ "args" : [
48+ {
49+ "prim" : " pair" ,
50+ "annots" : [
51+ " %xtz_transfer_type"
52+ ],
53+ "args" : [
54+ {
55+ "prim" : " mutez" ,
56+ "annots" : [
57+ " %amount"
58+ ]
59+ },
60+ {
61+ "prim" : " address" ,
62+ "annots" : [
63+ " %recipient"
64+ ]
65+ }
66+ ]
67+ },
68+ {
69+ "prim" : " pair" ,
70+ "annots" : [
71+ " %token_transfer_type"
72+ ],
73+ "args" : [
74+ {
75+ "prim" : " address" ,
76+ "annots" : [
77+ " %contract_address"
78+ ]
79+ },
80+ {
81+ "prim" : " list" ,
82+ "annots" : [
83+ " %transfer_list"
84+ ],
85+ "args" : [
86+ {
87+ "prim" : " pair" ,
88+ "args" : [
89+ {
90+ "prim" : " address" ,
91+ "annots" : [
92+ " %from_"
93+ ]
94+ },
95+ {
96+ "prim" : " list" ,
97+ "annots" : [
98+ " %txs"
99+ ],
100+ "args" : [
101+ {
102+ "prim" : " pair" ,
103+ "args" : [
104+ {
105+ "prim" : " address" ,
106+ "annots" : [
107+ " %to_"
108+ ]
109+ },
110+ {
111+ "prim" : " nat" ,
112+ "annots" : [
113+ " %token_id"
114+ ]
115+ },
116+ {
117+ "prim" : " nat" ,
118+ "annots" : [
119+ " %amount"
120+ ]
121+ }
122+ ]
123+ }
124+ ]
125+ }
126+ ]
127+ }
128+ ]
129+ }
130+ ]
131+ }
132+ ]
133+ }
134+ ]
135+ }
136+ ]
137+ }
Original file line number Diff line number Diff line change @@ -10,10 +10,12 @@ import { bytes2Char } from "@taquito/tzip16"
1010import { BaseDAO } from "services/contracts/baseDAO"
1111import { DAOTemplate } from "modules/creator/state"
1212import transfer_arg_type_michelson from "../../../../contracts/baseDAO/lambdaDAO/michelson/supported_lambda_types/transfer_proposal_type.json"
13+ import transfer_proposal_type_before_fa12 from "../../../../contracts/baseDAO/lambdaDAO/michelson/supported_lambda_types/transfer_proposal_type_before_fa1.2.json"
1314import update_contract_delegate_type_michelson from "../../../../contracts/baseDAO/lambdaDAO/michelson/supported_lambda_types/update_contract_delegate_proposal.json"
1415import update_guardian_type_michelson from "../../../../contracts/baseDAO/lambdaDAO/michelson/supported_lambda_types/update_guardian_proposal.json"
1516import configuration_proposal_type_michelson from "../../../../contracts/baseDAO/lambdaDAO/michelson/supported_lambda_types/configuration_proposal_type.json"
1617import { PMLambdaProposal } from "services/contracts/baseDAO/lambdaDAO/types"
18+ import { HUMANITEZ_DAO } from "services/config"
1719
1820export enum IndexerStatus {
1921 CREATED = "created" ,
@@ -324,7 +326,9 @@ export class LambdaProposal extends Proposal {
324326 )
325327
326328 if ( lambdaMetadata . lambdaHandler . handler_name === "transfer_proposal" ) {
327- const transfer_arg_schema = new Schema ( transfer_arg_type_michelson as MichelsonData )
329+ const transfer_michelson =
330+ this . dao . data . address === HUMANITEZ_DAO ? transfer_proposal_type_before_fa12 : transfer_arg_type_michelson
331+ const transfer_arg_schema = new Schema ( transfer_michelson as MichelsonData )
328332 const transfer_proposal_data = transfer_arg_schema . Execute ( lambdaMetadata . lambdaHandler . unpacked_argument )
329333
330334 const { agora_post_id, registry_diff, transfers } = transfer_proposal_data
You can’t perform that action at this time.
0 commit comments