Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIP-17 - Oracle/Token Wrapping #18

Merged
merged 5 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/actions/update_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ if [ -f ../fio.contracts/build/contracts/eosio.wrap/eosio.wrap.wasm ]; then
echo 'No wasm file found at $PWD/build/contracts/eosio.wrap'
fi

if [ -f ../fio.contracts/build/contracts/fio.oracle/fio.oracle.wasm ]; then
fio_oracle_name_path="$oldpath/../../fio.contracts/build/contracts/fio.oracle"
else
echo 'No wasm file found at $PWD/build/contracts/fio.oracle'
fi

cd ~/fio/$vChoice/bin

walletkey=$(head -n 1 $oldpath/../walletkey.ini)
Expand All @@ -76,3 +82,5 @@ sleep 1.5s
./clio -u http://localhost:8879 set contract -j fio.fee $fio_fee_name_path fio.fee.wasm fio.fee.abi --permission fio.fee@active
sleep 1.5s
./clio -u http://localhost:8889 set contract -j fio.treasury $fio_treasury_name_path fio.treasury.wasm fio.treasury.abi --permission fio.treasury@active
sleep 1.5s
./clio -u http://localhost:8879 set contract -j fio.oracle $fio_oracle_name_path fio.oracle.wasm fio.oracle.abi --permission fio.oracle@active
8 changes: 8 additions & 0 deletions scripts/fio_launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if [ $mChoice == 2 ]; then
cp ./contracts/fio.fee/fio.fee.abi ./build/contracts/fio.fee/fio.fee.abi
cp ./contracts/fio.address/fio.address.abi ./build/contracts/fio.address/fio.address.abi
cp ./contracts/fio.request.obt/fio.request.obt.abi ./build/contracts/fio.request.obt/fio.request.obt.abi
cp ./contracts/fio.oracle/fio.oracle.abi ./build/contracts/fio.oracle/fio.oracle.abi
echo COMPLETE - READY TO LAUNCH
exit -1
fi
Expand Down Expand Up @@ -125,6 +126,12 @@ if [ $mChoice == 1 ]; then
echo 'No wasm file found at $PWD/build/contracts/eosio.wrap'
fi

if [ -f ../fio.contracts/build/contracts/fio.oracle/fio.oracle.wasm ]; then
fio_oracle_name_path="$oldpath/../../fio.contracts/build/contracts/fio.oracle"
else
echo 'No wasm file found at $PWD/build/contracts/fio.oracle'
fi

#FIO Base Directory Check
if [ -f bin/baseContract/2.2.x/fio.contracts/build/contracts/eosio.bios/eosio.bios.wasm ]; then
eosio_bios_contract_base_path="$basepath/fio.contracts/build/contracts/eosio.bios"
Expand Down Expand Up @@ -196,6 +203,7 @@ if [ $mChoice == 1 ]; then
export fio_tpid_name_path
export fio_treasury_name_path
export eosio_wrap_name_path
export fio_oracle_name_path

export eosio_bios_contract_base_path
export fio_system_contract_base_path
Expand Down
3 changes: 3 additions & 0 deletions scripts/launch/02_import_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@
sleep 1s
./clio wallet import --private-key 5KF2B21xT5pE5G3LNA6LKJc6AP2pAd2EnfpAUrJH12SFV8NtvCD -n fio
sleep 1s

# fio.oracle
./clio wallet import --private-key 5JXkawfVHHZuTAdZrVpdkg4mUNfUytuw8uDUBWcAvb8YMK5R4yY -n fio
8 changes: 8 additions & 0 deletions scripts/launch/04_create_accounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ sleep 1.5s
./clio -u http://localhost:8879 set contract eosio.msig $eosio_msig_contract_base_path eosio.msig.wasm eosio.msig.abi
./clio -u http://localhost:8879 set contract -j fio.address $fio_contract_base_path fio.address.wasm fio.address.abi --permission fio.address@active
sleep 2s

echo creating dev account for escrow and marketplace
###### ESCROW
#Public Key: FIO5VEZHHBJwgzjVtLrdUYZ4dPbTFNHGLDcaB4gKDo2GHhwHbW7QE
#Private key: 5JXkawfVHHZuTAdZrVpdkg4mUNfUytuw8uDUBWcAvb8YMK5R4yY
#FIO Internal Account (actor name): i4wplnm2ogsd
./clio -u http://localhost:8879 create account eosio fio.oracle FIO7isxEua78KPVbGzKemH4nj2bWE52gqj8Hkac3tc7jKNvpfWzYS FIO7isxEua78KPVbGzKemH4nj2bWE52gqj8Hkac3tc7jKNvpfWzYS
sleep 2
4 changes: 4 additions & 0 deletions scripts/launch/09_set_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@
./clio -u http://localhost:8889 set account permission fio.treasury active --add-code
sleep 1s
./clio -u http://localhost:8889 push action fio.treasury startclock '{"":""}' -p fio.treasury@active

#fio.oracle
./clio -u http://localhost:8879 push action eosio setpriv '["fio.oracle",1]' -p eosio@active
./clio -u http://localhost:8879 set account permission fio.oracle active '{"threshold": 1,"keys": [{"key": "FIO7isxEua78KPVbGzKemH4nj2bWE52gqj8Hkac3tc7jKNvpfWzYS","weight": 1}],"accounts": [{"permission":{"actor":"fio.oracle","permission":"eosio.code"},"weight":1}]}}' 4000000000 owner -p fio.oracle@owner
6 changes: 6 additions & 0 deletions scripts/launch/12_add_actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ host='localhost:8889'
./clio -u http://$host push action eosio addaction '{"action":"rewardspaid","contract":"fio.tpid","actor":"eosio"}' --permission eosio
./clio -u http://$host push action eosio addaction '{"action":"updatetpid","contract":"fio.tpid","actor":"eosio"}' --permission eosio
./clio -u http://$host push action eosio addaction '{"action":"execute","contract":"eosio.wrap","actor":"eosio"}' --permission eosio
# fio.oracle:
./clio -u http://$host push action eosio addaction '{"action":"wraptokens","contract":"fio.oracle","actor":"eosio"}' --permission eosio
./clio -u http://$host push action eosio addaction '{"action":"unwraptokens","contract":"fio.oracle","actor":"eosio"}' --permission eosio
./clio -u http://$host push action eosio addaction '{"action":"regoracle","contract":"fio.oracle","actor":"eosio"}' --permission eosio
./clio -u http://$host push action eosio addaction '{"action":"unregoracle","contract":"fio.oracle","actor":"eosio"}' --permission eosio
./clio -u http://$host push action eosio addaction '{"action":"setoraclefee","contract":"fio.oracle","actor":"eosio"}' --permission eosio


# USED FOR TESTING:
Expand Down
4 changes: 4 additions & 0 deletions scripts/launch/19_bind_dev_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ sleep 1.5s
./clio -u http://localhost:8879 set contract -j fio.fee $fio_fee_name_path fio.fee.wasm fio.fee.abi --permission fio.fee@active
sleep 1.5s
./clio -u http://localhost:8889 set contract -j fio.treasury $fio_treasury_name_path fio.treasury.wasm fio.treasury.abi --permission fio.treasury@active

# oracle contract
./clio -u http://localhost:8889 set contract -j fio.oracle $fio_oracle_name_path fio.oracle.wasm fio.oracle.abi --permission fio.oracle@active
sleep 1.5s
8 changes: 6 additions & 2 deletions scripts/queries/tables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cd ~/fio/$vChoice/bin

if [ -z "$1" ]; then
read -p $'\n1. fioreqctxts 2. fionames 3. domains 4. accountmap 5. fioreqsts\n6. producers 7. voters 8. fdtnrewards 9. recordobts 10. FIO Token Stat 11. bundlevoters 12. fiotrxts\nChoose(#):' mChoice
read -p $'\n1. fioreqctxts 2. fionames 3. domains 4. accountmap 5. fioreqsts\n6. producers 7. voters 8. fdtnrewards 9. recordobts 10. FIO Token Stat 11. bundlevoters 12. fiotrxts 13. oraclelgdrs 14. oracless\nChoose(#):' mChoice
else
mChoice=$1
fi
Expand Down Expand Up @@ -31,6 +31,10 @@ elif [ $mChoice == 10 ]; then
elif [ $mChoice == 11 ]; then
./clio -u http://localhost:8889 get table fio.fee fio.fee bundlevoters
elif [ $mChoice == 12 ]; then
./clio -u http://localhost:8889 get table -l -1 fio.reqobt fio.reqobt fiotrxts
./clio -u http://localhost:8889 get table -l -1 fio.reqobt fio.reqobt fiotrxtss
elif [ $mChoice == 13 ]; then
./clio -u http://localhost:8889 get table -l -1 fio.oracle fio.oracle oraclelgdrs
elif [ $mChoice == 14 ]; then
./clio -u http://localhost:8889 get table -l -1 fio.oracle fio.oracle oracless

fi