Skip to content

Commit

Permalink
instantiate, create_campaign and invest_in_campaigns functions implem…
Browse files Browse the repository at this point in the history
…ented
  • Loading branch information
lucas-r-oliveira committed Nov 22, 2022
1 parent b490cb6 commit 871530b
Show file tree
Hide file tree
Showing 3 changed files with 371 additions and 239 deletions.
22 changes: 14 additions & 8 deletions 6-nfts-for-financial-applications/fond/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export pv1="$( echo ${output1} | cut -b 215-279)"


# CREATE SECONDARY ACCOUNT
#output2=$(resim new-account)
#export ac2="$( echo ${output2} | cut -b 60-121)"
#export pv2="$( echo ${output2} | cut -b 215-279)"
output2=$(resim new-account)
export ac2="$( echo ${output2} | cut -b 60-121)"
export pv2="$( echo ${output2} | cut -b 215-279)"

# CREATE SECONDARY ACCOUNT
#outputVendorAcc=$(resim new-account)
Expand All @@ -29,21 +29,27 @@ export pkg="$( echo ${output3}| grep -E '\bpackage_' | cut -b 23-125)"
# INSTANTIATE COMPONENT
# output4=$(resim call-function ${pkg} Fond instantiate_fond)
output4=$(resim call-function ${pkg} Fond instantiate_fond 800,${rdx})
export comp="$( echo ${output4}| grep -E '\bcomponent_' | cut -b 779-842)"
export comp="$( echo ${output4}| grep -E '\bcomponent_' | cut -b 1332-1396)"

# CREATE FIRST CAMPAIGN
resim call-method $comp create_campaign "MonaLisa" "You're an overrated piece of shit" 100.0

resim call-method $comp create_campaign "VanGogh" "I can't hear you" 50.0
resim show $ac1

#resim call-method $comp create_campaign "VanGogh" "I can't hear you" 50.0


# SWITCH ACCOUNTS
#resim set-default-account $ac2 $pv2
resim set-default-account $ac2 $pv2


# output5=$(resim show $ac2)
# export res2="$( echo ${output5}| cut -b 787-850)"

# INVEST IN ASSET
#resim call-method $comp invest_in_campaigns <AMOUNT>,$rdx <ASSET_NFT_ID>
resim call-method $comp invest_in_campaigns 100,$rdx 0

# INVEST IN CAMPAIGN 0
#resim call-method $comp invest_in_campaigns 5,$rdx 5.0 "0" $ac2

Expand Down Expand Up @@ -76,8 +82,8 @@ echo "package"
echo $pkg
echo "component"
echo $comp
echo "item vendor account"
echo $itemVendorAccount
#echo "item vendor account"
#echo $itemVendorAccount


# CHECK RESOURCES OF ACCOUNT 2
Expand Down
Loading

0 comments on commit 871530b

Please sign in to comment.