@@ -122,7 +122,7 @@ export abstract class BaseDAO {
122122 public static transfer_ownership = async ( newOwner : string , address : string , tezos : TezosToolkit ) => {
123123 const contract = await getContract ( tezos , address )
124124
125- return await contract . methods . transfer_ownership ( newOwner ) . send ( )
125+ return await contract . methodsObject . transfer_ownership ( newOwner ) . send ( )
126126 }
127127
128128 protected constructor ( public data : BaseDAOData ) { }
@@ -132,26 +132,26 @@ export abstract class BaseDAO {
132132 const initialBatch = await tezos . wallet . batch ( )
133133
134134 const batch = expiredProposalIds . reduce ( ( prev , current ) => {
135- return prev . withContractCall ( daoContract . methods . drop_proposal ( current ) )
135+ return prev . withContractCall ( daoContract . methodsObject . drop_proposal ( current ) )
136136 } , initialBatch )
137137
138- batch . withContractCall ( daoContract . methods . flush ( numerOfProposalsToFlush ) )
138+ batch . withContractCall ( daoContract . methodsObject . flush ( numerOfProposalsToFlush ) )
139139
140140 return await batch . send ( )
141141 }
142142
143143 public dropProposal = async ( proposalId : string , tezos : TezosToolkit ) => {
144144 const contract = await getContract ( tezos , this . data . address )
145145
146- return await contract . methods . drop_proposal ( proposalId ) . send ( )
146+ return await contract . methodsObject . drop_proposal ( proposalId ) . send ( )
147147 }
148148
149149 public dropAllExpired = async ( expiredProposalIds : string [ ] , tezos : TezosToolkit ) => {
150150 const daoContract = await getContract ( tezos , this . data . address )
151151 const initialBatch = await tezos . wallet . batch ( )
152152
153153 const batch = expiredProposalIds . reduce ( ( prev , current ) => {
154- return prev . withContractCall ( daoContract . methods . drop_proposal ( current ) )
154+ return prev . withContractCall ( daoContract . methodsObject . drop_proposal ( current ) )
155155 } , initialBatch )
156156
157157 return await batch . send ( )
@@ -162,7 +162,7 @@ export abstract class BaseDAO {
162162 const initialBatch = await tezos . wallet . batch ( )
163163
164164 const batch = proposals . reduce ( ( prev , current ) => {
165- return prev . withContractCall ( daoContract . methods . unstake_vote ( [ current ] ) )
165+ return prev . withContractCall ( daoContract . methodsObject . unstake_vote ( [ current ] ) )
166166 } , initialBatch )
167167
168168 return await batch . send ( )
@@ -171,10 +171,15 @@ export abstract class BaseDAO {
171171 public sendXtz = async ( xtzAmount : BigNumber , tezos : TezosToolkit ) => {
172172 const contract = await getContract ( tezos , this . data . address )
173173
174- return await contract . methods . callCustom ( "receive_xtz" , "" ) . send ( {
175- amount : xtzToMutez ( xtzAmount ) . toNumber ( ) ,
176- mutez : true
177- } )
174+ return await contract . methodsObject
175+ . callCustom ( {
176+ 0 : "receive_xtz" ,
177+ 1 : ""
178+ } )
179+ . send ( {
180+ amount : xtzToMutez ( xtzAmount ) . toNumber ( ) ,
181+ mutez : true
182+ } )
178183 }
179184
180185 public vote = async ( {
@@ -189,7 +194,7 @@ export abstract class BaseDAO {
189194 tezos : TezosToolkit
190195 } ) => {
191196 const contract = await getContract ( tezos , this . data . address )
192- return await contract . methods
197+ return await contract . methodsObject
193198 . vote ( [
194199 {
195200 argument : {
@@ -210,7 +215,7 @@ export abstract class BaseDAO {
210215 const batch = await tezos . wallet
211216 . batch ( )
212217 . withContractCall (
213- govTokenContract . methods . update_operators ( [
218+ govTokenContract . methodsObject . update_operators ( [
214219 {
215220 add_operator : {
216221 owner : await tezos . wallet . pkh ( ) ,
@@ -220,9 +225,9 @@ export abstract class BaseDAO {
220225 }
221226 ] )
222227 )
223- . withContractCall ( daoContract . methods . freeze ( formatUnits ( amount , tokenMetadata . decimals ) . toString ( ) ) )
228+ . withContractCall ( daoContract . methodsObject . freeze ( formatUnits ( amount , tokenMetadata . decimals ) . toString ( ) ) )
224229 . withContractCall (
225- govTokenContract . methods . update_operators ( [
230+ govTokenContract . methodsObject . update_operators ( [
226231 {
227232 remove_operator : {
228233 owner : await tezos . wallet . pkh ( ) ,
@@ -239,13 +244,13 @@ export abstract class BaseDAO {
239244 public unfreeze = async ( amount : BigNumber , tezos : TezosToolkit ) => {
240245 const contract = await getContract ( tezos , this . data . address )
241246
242- return await contract . methods . unfreeze ( formatUnits ( amount , this . data . token . decimals ) . toString ( ) ) . send ( )
247+ return await contract . methodsObject . unfreeze ( formatUnits ( amount , this . data . token . decimals ) . toString ( ) ) . send ( )
243248 }
244249
245250 public unstakeVotes = async ( proposalId : string , tezos : TezosToolkit ) => {
246251 const contract = await getContract ( tezos , this . data . address )
247252
248- return await contract . methods . unstake_vote ( [ proposalId ] ) . send ( )
253+ return await contract . methodsObject . unstake_vote ( [ proposalId ] ) . send ( )
249254 }
250255
251256 static async encodeProposalMetadata ( dataToEncode : any , michelsonSchemaString : string , tezos : TezosToolkit ) {
@@ -330,11 +335,11 @@ export abstract class BaseDAO {
330335 proposal_meta_michelson_type
331336 )
332337
333- const contractMethod = contract . methods . propose (
334- await tezos . wallet . pkh ( ) ,
335- formatUnits ( new BigNumber ( this . data . extra . frozen_extra_value ) , this . data . token . decimals ) ,
336- proposalMetadata . bytes
337- )
338+ const contractMethod = contract . methodsObject . propose ( {
339+ from : await tezos . wallet . pkh ( ) ,
340+ frozen_token : formatUnits ( new BigNumber ( this . data . extra . frozen_extra_value ) , this . data . token . decimals ) ,
341+ proposal_metadata : proposalMetadata . bytes
342+ } )
338343
339344 return await contractMethod . send ( )
340345 }
0 commit comments