@@ -157,16 +157,16 @@ async function createMint(
157157// return vault;
158158// }
159159
160- // async function initializeDAO(META: any, USDC: any) {
161- // await autocratProgram.methods
162- // .initializeDao()
163- // .accounts({
164- // dao,
165- // metaMint: META,
166- // usdcMint: USDC,
167- // })
168- // .rpc();
169- // }
160+ async function initializeDAO ( META : any , USDC : any ) {
161+ await autocratProgram . methods
162+ . initializeDao ( )
163+ . accounts ( {
164+ dao,
165+ metaMint : META ,
166+ usdcMint : USDC ,
167+ } )
168+ . rpc ( ) ;
169+ }
170170
171171// async function initializeProposal() {
172172// const accounts = [
@@ -703,85 +703,89 @@ async function main() {
703703 let metaKP = Keypair . fromSecretKey ( new Uint8Array (
704704[ 198 , 220 , 220 , 16 , 30 , 46 , 95 , 30 , 142 , 241 , 177 , 114 , 188 , 149 , 13 , 195 , 94 , 238 , 149 , 12 , 97 , 136 , 195 , 247 , 135 , 159 , 224 , 249 , 19 , 125 , 121 , 149 , 5 , 46 , 211 , 70 , 74 , 232 , 252 , 23 , 217 , 77 , 149 , 94 , 232 , 103 , 3 , 173 , 198 , 146 , 148 , 34 , 223 , 156 , 53 , 149 , 1 , 246 , 213 , 183 , 221 , 233 , 82 , 165 ]
705705 ) ) ;
706- console . log ( metaKP . publicKey . toBase58 ( ) )
707- // let META = await createMint(provider.publicKey, PublicKey.default, 9, metaKP);
706+ // console.log(metaKP.publicKey.toBase58())
707+ // // let META = await createMint(provider.publicKey, PublicKey.default, 9, metaKP);
708708 let META = metaKP . publicKey ;
709- console . log ( daoTreasury . toBase58 ( ) ) ;
709+ let USDC = new PublicKey ( "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ) ;
710+ // console.log(daoTreasury.toBase58());
711+ // let USDC = await createMint(provider.publicKey, provider.publicKey, 6);
712+ await initializeDAO ( META , USDC ) ;
713+ // console.log(await autocratProgram.account.dao.fetch(dao));
710714
711- const myMetaAcc = await token . getOrCreateAssociatedTokenAccount (
712- provider . connection ,
713- payer ,
714- META ,
715- payer . publicKey
716- ) ;
715+ // const myMetaAcc = await token.getOrCreateAssociatedTokenAccount(
716+ // provider.connection,
717+ // payer,
718+ // META,
719+ // payer.publicKey
720+ // );
717721
718- const treasuryMetaAcc = await token . getOrCreateAssociatedTokenAccount (
719- provider . connection ,
720- payer ,
721- META ,
722- daoTreasury ,
723- true
724- ) ;
722+ // const treasuryMetaAcc = await token.getOrCreateAssociatedTokenAccount(
723+ // provider.connection,
724+ // payer,
725+ // META,
726+ // daoTreasury,
727+ // true
728+ // );
725729
726- // await token.mintTo(
727- // provider.connection,
728- // payer,
729- // META,
730- // myMetaAcc.address,
731- // payer,
732- // 10_000n * 1_000_000_000n
733- // );
734-
735- // await token.mintTo(
736- // provider.connection,
737- // payer,
738- // META,
739- // treasuryMetaAcc.address,
740- // payer,
741- // 990_000n * 1_000_000_000n
742- // );
743-
744- const createMetadataInstruction = createCreateMetadataAccountV3Instruction (
745- {
746- metadata : PublicKey . findProgramAddressSync (
747- [
748- Buffer . from ( "metadata" ) ,
749- PROGRAM_ID . toBuffer ( ) ,
750- META . toBuffer ( ) ,
751- ] ,
752- PROGRAM_ID ,
753- ) [ 0 ] ,
754- mint : META ,
755- mintAuthority : payer . publicKey ,
756- payer : payer . publicKey ,
757- updateAuthority : payer . publicKey ,
758- } ,
759- {
760- createMetadataAccountArgsV3 : {
761- data : {
762- name : "META" ,
763- symbol : "META" ,
764- uri : "https://ftgnmxferax7tpgqyzdo76sisk5fhpsjv34omvgz33m7udvnsfba.arweave.net/LMzWXKSIL_m80MZG7_pIkrpTvkmu-OZU2d7Z-g6tkUI" ,
765- creators : null ,
766- sellerFeeBasisPoints : 0 ,
767- uses : null ,
768- collection : null ,
769- } ,
770- isMutable : false ,
771- collectionDetails : null ,
772- } ,
773- } ,
774- ) ;
775-
776- await anchor . web3 . sendAndConfirmTransaction ( provider . connection , new anchor . web3 . Transaction ( ) . add ( createMetadataInstruction ) , [ payer ] ) ;
777- await token . setAuthority (
778- provider . connection ,
779- payer ,
780- META ,
781- provider . publicKey ,
782- token . AuthorityType . MintTokens ,
783- null ,
784- ) ;
730+ // // await token.mintTo(
731+ // // provider.connection,
732+ // // payer,
733+ // // META,
734+ // // myMetaAcc.address,
735+ // // payer,
736+ // // 10_000n * 1_000_000_000n
737+ // // );
738+
739+ // // await token.mintTo(
740+ // // provider.connection,
741+ // // payer,
742+ // // META,
743+ // // treasuryMetaAcc.address,
744+ // // payer,
745+ // // 990_000n * 1_000_000_000n
746+ // // );
747+
748+ // const createMetadataInstruction = createCreateMetadataAccountV3Instruction(
749+ // {
750+ // metadata: PublicKey.findProgramAddressSync(
751+ // [
752+ // Buffer.from("metadata"),
753+ // PROGRAM_ID.toBuffer(),
754+ // META.toBuffer(),
755+ // ],
756+ // PROGRAM_ID,
757+ // )[0],
758+ // mint: META,
759+ // mintAuthority: payer.publicKey,
760+ // payer: payer.publicKey,
761+ // updateAuthority: payer.publicKey,
762+ // },
763+ // {
764+ // createMetadataAccountArgsV3: {
765+ // data: {
766+ // name: "META",
767+ // symbol: "META",
768+ // uri: "https://ftgnmxferax7tpgqyzdo76sisk5fhpsjv34omvgz33m7udvnsfba.arweave.net/LMzWXKSIL_m80MZG7_pIkrpTvkmu-OZU2d7Z-g6tkUI",
769+ // creators: null,
770+ // sellerFeeBasisPoints: 0,
771+ // uses: null,
772+ // collection: null,
773+ // },
774+ // isMutable: false,
775+ // collectionDetails: null,
776+ // },
777+ // },
778+ // );
779+
780+ // await anchor.web3.sendAndConfirmTransaction(provider.connection, new anchor.web3.Transaction().add(createMetadataInstruction), [payer]);
781+ // await token.setAuthority(
782+ // provider.connection,
783+ // payer,
784+ // META,
785+ // provider.publicKey,
786+ // token.AuthorityType.MintTokens,
787+ // null,
788+ // );
785789
786790
787791}
0 commit comments