WIP
Forge Contract Executes
Table of contents
Stake YFD
Deposits YFD in Forge. The below JSON should be base64 encoded and included in the "msg" field of a YFD execute send message. The YFD contract will execute the stake message on the Forge.
{
stake: {
lock_duration: 10512000
}
}
{
"stake": {
"lock_duration": 10512000
}
}
Create Vault Proposal
Submits vault proposal to Forge. The below JSON should be base64 encoded and included in the "msg" field of a YFD execute send message. The YFD contract will execute the create_vault_proposal message on the Forge.
{
create_vault_proposal: {
msg: {
proposal_info: {
name: "Foo_name",
ticker: "TEST",
proposal_url: "www.example.com",
tvl_limit: "1000000",
contact: [
"[email protected]"
],
developer: "[developer address]",
development_cost: "67000",
funding_only: false,
funding_denomination: "[YFD token]",
nft_quantity: 100,
statement_of_work: "www.example.com",
num_payments: 3,
payment_frequency: 10000,
github: "www.example.com",
self_vouched_information: "www.example.com",
}
}
}
}
{
"create_vault_proposal": {
"msg": {
"proposal_info": {
"name": "Foo_name",
"ticker": "TEST",
"proposal_url": "www.example.com",
"tvl_limit": "1000000",
"contact": [
"[email protected]"
],
"developer": "[developer address]",
"development_cost": "67000",
"funding_only": false,
"funding_denomination": "[YFD token]",
"nft_quantity": 100,
"statement_of_work": "www.example.com",
"num_payments": 3,
"payment_frequency": 10000,
"github": "www.example.com",
"self_vouched_information": "www.example.com"
}
}
}
}
Create Proposal
These create_proposal messages are executed directly on the Forge contract. In Terra Station, go to Contract, enter the Forge address in the search bar, and click Execute.
Create Message Proposal
Creates a message proposal.
{
create_proposal: {
proposal_type: {
message: {
contract_addr: "[proposal vote address]",
message: encodeBase64({ finalize_vote: {} }),
}
},
emergency: true,
justification_link: "example.com"
}
}
{
"create_proposal": {
"proposal_type": {
"message": {
"contract_addr": "[proposal vote address]",
"message": "[base64 encoded message]"
}
},
"emergency": true,
"justification_link": "example.com"
}
}
Create Parameter Proposal
Creates a parameter proposal.
{
create_proposal: {
proposal_type: {
parameter: {
name: "GovernanceVoteLength",
change: {
change: {
value: "400",
}
}
}
},
emergency: true,
justification_link: "example.com"
}
}
{
"create_proposal": {
"proposal_type": {
"parameter": {
"name": "GovernanceVoteLength",
"change": {
"change": {
"value": "400"
}
}
}
},
"emergency": true,
"justification_link": "example.com"
}
}
Create Address Whitelist Proposal
Adds a new address to the whitelist with specified roles.
{
create_proposal: {
proposal_type: {
address_whitelist: {
address: "[New address]",
change: {
new: {
name: "Developer_name",
image_link: "www.example.com",
roles: [
"developer",
"booster"
],
links: {
github: "https://github.com/example-user-account",
keybase: "",
telegram: "",
twitter: "",
url: "",
}
}
}
}
},
emergency: false,
justification_link: "example.com"
}
}
{
"create_proposal": {
"proposal_type": {
"address_whitelist": {
"address": "[New address]",
"change": {
"new": {
"name": "Developer_name",
"image_link": "www.example.com",
"roles": [
"developer",
"booster",
"strategist",
"proposer",
"payee"
],
"links": {
"github": "https://github.com/example-user-account",
"keybase": "",
"telegram": "",
"twitter": "",
"url": ""
}
}
}
}
},
"emergency": false,
"justification_link": "example.com"
}
}
Create Token Whitelist Proposal
Adds a token to the whitelist. This is necessary before a vault proposal can be instatiated.
{
create_proposal: {
proposal_type: {
token_whitelist: {
token: "[YFD_address]",
change: {
new: {
name: "YFD",
asset_type: "cw20",
stable: false,
oracle_address: "",
token_to_usd: "0.01",
}
}
}
},
emergency: true,
justification_link: "example.com"
}
}
{
"create_proposal": {
"proposal_type": {
"token_whitelist": {
"token": "[YFD_address]",
"change": {
"new": {
"name": "YFD",
"asset_type": "cw20",
"stable": false,
"oracle_address": ""
"toten_to_usd": "0.01"
}
}
}
},
"emergency": true,
"justification_link": "example.com"
}
}
Create Vault Proposal Stop Proposal
Create a proposal to stop a vault proposal. The proposal ID can be queried with all_proposals.
{
create_proposal: {
proposal_type: {
vault_proposal_stop: {
vault_proposal_idx: "1"
}
},
emergency: true,
justification_link: "[link to IPFS or url]"
}
}
{
"create_proposal": {
"proposal_type": {
"vault_proposal_stop": {
"vault_proposal_idx": "1"
}
},
"emergency": true,
"justification_link": "[link to IPFS or url]"
}
}
Create Vault Liquidate Proposal
{
create_proposal: {
proposal_type: {
vault_liquidate: {
vault_address: "[vault address]"
}
},
emergency: true,
justification_link: "example.com"
}
}
{
"create_proposal": {
"proposal_type": {
"vault_liquidate": {
"vault_address": "[vault address]"
}
},
"emergency": true,
"justification_link": "example.com"
}
}
Create Text Proposal
{
create_proposal: {
proposal_type: {
text: {
text: "This is a text vault proposal test"
}
},
emergency: false,
justification_link: "example.com"
}
}
{
"create_proposal": {
"proposal_type": {
"text": {
"text": "This is a text vault proposal test"
}
},
"emergency": false,
"justification_link": "example.com"
}
}
Create Vault Migrate Proposal
{
create_proposal: {
proposal_type: {
vault_migrate: {
vault_index: "1",
new_code_id: "[new vault code Id]",
},
},
emergency: true,
justification_link: "String"
}
}
{
"create_proposal": {
"proposal_type": {
"vault_migrate": {
"vault_index": "1",
"new_code_id": "[new vault code Id]"
}
},
"emergency": true,
"justification_link": "String"
}
}
Finalize Proposal
Finalize a proposal using proposal index number from all_proposals query.
{
finalize_proposal: {
idx: "1"
}
}
{
"finalize_proposal": {
"idx": "1"
}
}
Claim YFD
Claim YFD previously deposited into the Forge using the index number from balance_detail query. `deposit_timestamp returned` uses [env.block.time](https://docs.rs/cosmwasm-std/latest/cosmwasm_std/struct.BlockInfo.html) which is UNIX epoch represented in nanoseconds. Divide by 1,000,000 to receive a traditional UNIX timestamp. Timestamp data is generated on line 1083 of Forge `contract.rs`.
{
claim: {
stake_idx: 1
}
}
{
"claim": {
"stake_idx": "1"
}
}