Skip to content

Commit

Permalink
Topic/batch 100 (#24)
Browse files Browse the repository at this point in the history
* fix compensation fill

* batch-004 initial

* bump fill

* fix comment

* add comment

* add file

* batch-100 initial

* add files
  • Loading branch information
temptemp3 authored Nov 5, 2024
1 parent 6556b49 commit b268630
Show file tree
Hide file tree
Showing 10 changed files with 932 additions and 24 deletions.
47 changes: 47 additions & 0 deletions src/VERSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# VERSIONS.md

This file keeps track of all updates, changes, and improvements made to the smart contracts in this project. Each version entry includes a description of the updates and any important notes.

---

## Version 1.2

**Release Date:** 2024-11-04

### Updates

- Remove reduce_total override introduced in version 1.1.

### Notes

- Update applied to contracts upgraded in batch 003.

---

## Version 1.1

**Release Date:** 2024-10-31

### New Features

- Override reduce_total method to allow for the reduction of the total after funding.

### Notes

- Update applied to select contracts in batch 004 to fix overright in batch 003. To be reverted.

---

## Version 1.0

**Release Date:** 2024-09-30

### Features

- Smart contract staking for Voi Network.

### Notes

- Smart contract audited

---
25 changes: 13 additions & 12 deletions src/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,8 @@ def abort_funding(self) -> None:
def update(self) -> None:
assert Txn.sender == self.upgrader, "must be upgrader"
assert self.updatable == UInt64(1), "not approved"
self.deployment_version = UInt64(1)
self.deployment_version = UInt64(2)


# kill method
# only callable by upgrader
Expand All @@ -1075,17 +1076,17 @@ def kill(self) -> None:
close_offline_on_delete(self.funder)

# override reduce_total method
@arc4.abimethod
def reduce_total(self, adjustment: arc4.UInt64) -> None:
#########################################
assert Txn.sender == self.funder, "must be funder"
#########################################
assert adjustment <= self.total, "adjustment accurate"
#########################################
total = self.total - adjustment.native
itxn.Payment(receiver=self.funder, amount=adjustment.native, fee=0).submit()
arc4.emit(TotalReduced(adjustment, arc4.UInt64(total)))
self.total = total
# @arc4.abimethod
# def reduce_total(self, adjustment: arc4.UInt64) -> None:
# #########################################
# assert Txn.sender == self.funder, "must be funder"
# #########################################
# assert adjustment <= self.total, "adjustment accurate"
# #########################################
# total = self.total - adjustment.native
# itxn.Payment(receiver=self.funder, amount=adjustment.native, fee=0).submit()
# arc4.emit(TotalReduced(adjustment, arc4.UInt64(total)))
# self.total = total


##################################################
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/clients/AirdropClient.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/scripts/clients/AirdropFactoryClient.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/scripts/clients/CompensationFactoryClient.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/scripts/clients/StakingFactoryClient.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/scripts/program/compensation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ program
program
.command("prepare-fill")
.description("Fill the contracts")
.option("-f, --file <path>", "Path to the JSON file", "tmp/fill-004.csv")
.option("-f, --file <path>", "Path to the JSON file", "tmp/fill-100.csv")
.option(
"-o, --file2 <path>",
"Path to the error log file",
"tmp/fill-004.csv.json"
"tmp/fill-100.csv.json"
)
.option("--apid <number>", "Application ID")
.option("--sender <address>", "Sender address")
Expand Down Expand Up @@ -322,7 +322,7 @@ program
program
.command("execute-fill")
.description("Execute the fill")
.option("-f, --file <path>", "Path to the JSON file", "tmp/fill-004.csv.json")
.option("-f, --file <path>", "Path to the JSON file", "tmp/fill-100.csv.json")
.option("--sender <address>", "Sender address")
.option("--nodryrun", "No dry run", false)
.option("--delay <number>", "Delay in seconds", "0")
Expand Down Expand Up @@ -369,12 +369,12 @@ program
.option(
"-f, --file <path>",
"Path to the JSON file",
"tmp/compensation-004.csv"
"tmp/compensation-100.csv"
)
.option(
"-o, --file2 <path>",
"Path to the error log file",
"tmp/compensation-004.csv.json"
"tmp/compensation-100.csv.json"
)
.option("--apid <number>", "Application ID")
.option("--sender <address>", "Sender address")
Expand Down
128 changes: 128 additions & 0 deletions src/scripts/program/tmp/compensation/100.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "RTKWX3FTDNNIHMAWHK5SDPKH3VRPPW7OS5ZLWN6RFZODF7E22YOBK2OGPE",
"amount": 117795.46
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "C4SUISHGS3XW7YPXAXCPOTNISUKABNG5GPGZVXNHRKBEOYDDIO4XJPXHJM",
"amount": 3514.52
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "3COJDBTUW7UNXFY4YPQ5PTFYIT5HE7FUZZSACVHPO7PUIQJV6L2JH7JGLE",
"amount": 856.164384
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "YUODLUC2RXSHKN3MRK4WS32F2AEAVQ6BP7CVOZT6O4K56W6ES72ZY4TEZE",
"amount": 856.164384
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "4GA6CVGDJHXKXEG4IX5LIHLVI547UK56X7TV5SDVLPXWRDWVLMOFAIKH7E",
"amount": 50000
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "NJ2ZL453WEYBOCJQQPEYWANE2WULO2ICOWHQZWOTNL63TXQOMWZYOGPA5Y",
"amount": 50000
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "WHNTB6IGOEH52PSQIFVHBKWVHFDCZG2DRTYQ3TVI2DGCECVZWL7MMTBDO4",
"amount": 50000
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "CSPIHYASDA5OMAZ4BX6VMZ7IYEZFX3WXSWWK4RA2H4KLSHTISURHRVKD2I",
"amount": 40132.92
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "4GBLBF4UX25F2RQVYNJWSFE6SX4UOWPJTFZP5EDKIEUSDVKTQLGUZWBRIE",
"amount": 27208.76
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "DLDOGORMUQ24SEMVU5DYEV57KCHIO3I4VUT3NHF32DDAYUEZ473F3W5FWE",
"amount": 19620.54
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "PW5CEC44ELLZBZ5KGJJ7WMTD54N2FJIZ2RBQC5IRPKFYZETAKQKKJQG3ZY",
"amount": 17874.64
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "BLBIDUUDUJXHR424SXS2YRDSRLLNKIFLGAH25PSVIVBKDBMLCKP2V7MFR4",
"amount": 17542.09
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "XLPYIBUNNCKPSSFJCNDG5KEPJYOQZWBMPQUCOCHL3EUXKX4E6EHW75ILL4",
"amount": 13906.7
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "P6R326CBOUECOYPDDSMEACF4KCLWXQ5LNKJ3UONIGIZNNOKP5KVACD3TCI",
"amount": 8994.01
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "M7AEXJL6CPLY5T6WWHEJRWRCMY76P5MZEQSUPXZQGX2JKZT4DYAQVOO6QY",
"amount": 604.64
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "WA5YEJ3HC5WSRJTMCDWA7PJBR2TJAOMS5XNW5QFWTFC7JZ3FRORJDN5LDI",
"amount": 83.14
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"amount": 16793.85
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "33BJJKEVOCZVH5DHUR2S7LQ437TWADGWEDNW7M6NOD3WUYITTTML57PIYQ",
"amount": 50000
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "F3P3HR6QAWNASZR7T77TFBZQZOXJ6YFLIEMCOGTTO22H6QFX7GDNUE4TMA",
"amount": 30012.77343
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "YWOV657QGRPF36HPOD2XMZWDHY3HD6ZXYIODISJQTZ2JWVT5WV6NAB4ELU",
"amount": 24639.04341
},
{
"contractId": "456668",
"sender": "62TIVJSZOS4DRSSYYDDZELQAGFYQC5JWKCHRBPPYKTZN2OOOXTGLB5ZJ4E",
"address": "OVQ3Y52NSKUFLHHLY4LQ5SHNEM3ZSAFNXMWNUZJX2IBNZAF7P5GXHGEOJM",
"amount": 49965.86385
}
]
Loading

0 comments on commit b268630

Please sign in to comment.