Skip to main content

Create a Enterprise poll

To setup or cancel fundings, Enterprise requires native governance polls of specific type: ExecuteContractProposal.

This type is not yet supported in Terra Station, so the best way to create it is using a Terra.js script.

The gist of such script would be:


const lcd = new LCDClient({
URL: LCD_URL,
chainID: CHAIN_ID,
});
const wallet = lcd.wallet(
new MnemonicKey({
mnemonic: WALLET_MNEMONIC,
})
);
const project_wallet = lcd.wallet(
new MnemonicKey({
mnemonic: PROJECT_WALLET_MNEMONIC,
})
);
// Give Enterprise an allowance on project's CW20 token
let allowanceMsg = new MsgExecuteContract(
PROJECT_WALLET_ADDRESS,
PROJECT_TOKEN_ADDRESS,
{
increase_allowance: {
spender: VCDAO_ADDRESS,
amount: "1000000000",
},
}
);
let res = await sendTransaction(lcd, project_wallet, [allowanceMsg]);
let proposal = new ExecuteContractProposal(
"Title",
"Description",
VCDAO_ADDRESS,
VCDAO_ADDRESS,
msg // either ExecuteFundingRequest or CancelFundingDeal msg
);
let result = await sendTransaction(lcd, wallet, [
new MsgSubmitProposal(
proposal,
[new Coin("uluna", 10_000_000)],
WALLET_ADDRESS
),
]);