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

김우성 제출 #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ smart_contracts.nft_marketplace.contract.NftMarketplace.approval_program:
callsub __init__

main_entrypoint@2:
// smart_contracts/nft_marketplace/contract.py:28
// smart_contracts/nft_marketplace/contract.py:20
// class NftMarketplace(arc4.ARC4Contract):
txn NumAppArgs
bz main_bare_routing@9
Expand All @@ -18,14 +18,14 @@ main_entrypoint@2:
err // reject transaction

main_bootstrap_route@4:
// smart_contracts/nft_marketplace/contract.py:96
// smart_contracts/nft_marketplace/contract.py:90
// @arc4.abimethod
txn OnCompletion
!
assert // OnCompletion is NoOp
txn ApplicationID
assert // is not creating
// smart_contracts/nft_marketplace/contract.py:28
// smart_contracts/nft_marketplace/contract.py:20
// class NftMarketplace(arc4.ARC4Contract):
txna ApplicationArgs 1
btoi
Expand All @@ -40,21 +40,21 @@ main_bootstrap_route@4:
int pay
==
assert // transaction type is pay
// smart_contracts/nft_marketplace/contract.py:96
// smart_contracts/nft_marketplace/contract.py:90
// @arc4.abimethod
callsub bootstrap
int 1
return

main_buy_route@5:
// smart_contracts/nft_marketplace/contract.py:144
// smart_contracts/nft_marketplace/contract.py:136
// @arc4.abimethod
txn OnCompletion
!
assert // OnCompletion is NoOp
txn ApplicationID
assert // is not creating
// smart_contracts/nft_marketplace/contract.py:28
// smart_contracts/nft_marketplace/contract.py:20
// class NftMarketplace(arc4.ARC4Contract):
txn GroupIndex
int 1
Expand All @@ -66,14 +66,14 @@ main_buy_route@5:
assert // transaction type is pay
txna ApplicationArgs 1
btoi
// smart_contracts/nft_marketplace/contract.py:144
// smart_contracts/nft_marketplace/contract.py:136
// @arc4.abimethod
callsub buy
int 1
return

main_withdraw_and_delete_route@6:
// smart_contracts/nft_marketplace/contract.py:199
// smart_contracts/nft_marketplace/contract.py:196
// @arc4.abimethod(allow_actions=["DeleteApplication"])
txn OnCompletion
int DeleteApplication
Expand All @@ -86,7 +86,7 @@ main_withdraw_and_delete_route@6:
return

main_bare_routing@9:
// smart_contracts/nft_marketplace/contract.py:28
// smart_contracts/nft_marketplace/contract.py:20
// class NftMarketplace(arc4.ARC4Contract):
txn OnCompletion
!
Expand All @@ -100,34 +100,34 @@ main_bare_routing@9:

// smart_contracts.nft_marketplace.contract.NftMarketplace.bootstrap(asset: uint64, unitary_price: uint64, mbr_pay: uint64) -> void:
bootstrap:
// smart_contracts/nft_marketplace/contract.py:96-99
// smart_contracts/nft_marketplace/contract.py:90-93
// @arc4.abimethod
// def bootstrap(
// self, asset: Asset, unitary_price: UInt64, mbr_pay: gtxn.PaymentTransaction
// ) -> None:
proto 3 0
// smart_contracts/nft_marketplace/contract.py:100
// smart_contracts/nft_marketplace/contract.py:94
// assert Txn.sender == Global.creator_address
txn Sender
global CreatorAddress
==
assert
// smart_contracts/nft_marketplace/contract.py:101
// assert not self.bootstrapped
// smart_contracts/nft_marketplace/contract.py:95
// assert self.bootstrapped == False
int 0
byte "bootstrapped"
app_global_get_ex
assert // check bootstrapped exists
!
assert
// smart_contracts/nft_marketplace/contract.py:102
// smart_contracts/nft_marketplace/contract.py:96
// assert mbr_pay.receiver == Global.current_application_address
frame_dig -1
gtxns Receiver
global CurrentApplicationAddress
==
assert
// smart_contracts/nft_marketplace/contract.py:103
// smart_contracts/nft_marketplace/contract.py:97
// assert mbr_pay.amount == Global.min_balance + Global.asset_opt_in_min_balance
frame_dig -1
gtxns Amount
Expand All @@ -136,63 +136,47 @@ bootstrap:
+
==
assert
// smart_contracts/nft_marketplace/contract.py:105
// smart_contracts/nft_marketplace/contract.py:99
// self.asset_id = asset.id
byte "asset_id"
frame_dig -3
app_global_put
// smart_contracts/nft_marketplace/contract.py:106
// smart_contracts/nft_marketplace/contract.py:100
// self.unitary_price = unitary_price
byte "unitary_price"
frame_dig -2
app_global_put
// smart_contracts/nft_marketplace/contract.py:107
// smart_contracts/nft_marketplace/contract.py:101
// self.bootstrapped = True
byte "bootstrapped"
int 1
app_global_put
// smart_contracts/nft_marketplace/contract.py:109-113
// itxn.AssetTransfer(
// xfer_asset=asset,
// asset_receiver=Global.current_application_address,
// asset_amount=0,
// ).submit()
// smart_contracts/nft_marketplace/contract.py:102
// itxn.AssetTransfer(xfer_asset=asset, asset_receiver=Global.current_application_address, asset_amount=0).submit()
itxn_begin
// smart_contracts/nft_marketplace/contract.py:111
// asset_receiver=Global.current_application_address,
global CurrentApplicationAddress
// smart_contracts/nft_marketplace/contract.py:112
// asset_amount=0,
int 0
itxn_field AssetAmount
itxn_field AssetReceiver
frame_dig -3
itxn_field XferAsset
// smart_contracts/nft_marketplace/contract.py:109
// itxn.AssetTransfer(
int axfer
itxn_field TypeEnum
// smart_contracts/nft_marketplace/contract.py:109-113
// itxn.AssetTransfer(
// xfer_asset=asset,
// asset_receiver=Global.current_application_address,
// asset_amount=0,
// ).submit()
itxn_submit
retsub


// smart_contracts.nft_marketplace.contract.NftMarketplace.buy(buyer_txn: uint64, quantity: uint64) -> void:
buy:
// smart_contracts/nft_marketplace/contract.py:144-149
// smart_contracts/nft_marketplace/contract.py:136-141
// @arc4.abimethod
// def buy(
// self,
// buyer_txn: gtxn.PaymentTransaction,
// quantity: UInt64,
// ) -> None:
proto 2 0
// smart_contracts/nft_marketplace/contract.py:150
// smart_contracts/nft_marketplace/contract.py:143
// assert self.bootstrapped == True
int 0
byte "bootstrapped"
Expand All @@ -201,21 +185,22 @@ buy:
int 1
==
assert
// smart_contracts/nft_marketplace/contract.py:151
// smart_contracts/nft_marketplace/contract.py:144
// assert buyer_txn.sender == Txn.sender
frame_dig -2
gtxns Sender
dup
txn Sender
==
assert
// smart_contracts/nft_marketplace/contract.py:152
// smart_contracts/nft_marketplace/contract.py:145
// assert buyer_txn.receiver == Global.current_application_address
frame_dig -2
gtxns Receiver
global CurrentApplicationAddress
==
assert
// smart_contracts/nft_marketplace/contract.py:153
// smart_contracts/nft_marketplace/contract.py:146
// assert buyer_txn.amount == self.unitary_price * quantity
frame_dig -2
gtxns Amount
Expand All @@ -227,128 +212,79 @@ buy:
*
==
assert
// smart_contracts/nft_marketplace/contract.py:155-159
// itxn.AssetTransfer(
// xfer_asset=self.asset_id,
// asset_receiver=Txn.sender,
// asset_amount=quantity,
// ).submit()
// smart_contracts/nft_marketplace/contract.py:148
// itxn.AssetTransfer(xfer_asset=self.asset_id, asset_receiver=buyer_txn.sender, asset_amount=quantity).submit()
itxn_begin
// smart_contracts/nft_marketplace/contract.py:156
// xfer_asset=self.asset_id,
int 0
byte "asset_id"
app_global_get_ex
assert // check asset_id exists
// smart_contracts/nft_marketplace/contract.py:157
// asset_receiver=Txn.sender,
txn Sender
frame_dig -1
itxn_field AssetAmount
itxn_field AssetReceiver
itxn_field XferAsset
// smart_contracts/nft_marketplace/contract.py:155
// itxn.AssetTransfer(
itxn_field AssetReceiver
int axfer
itxn_field TypeEnum
// smart_contracts/nft_marketplace/contract.py:155-159
// itxn.AssetTransfer(
// xfer_asset=self.asset_id,
// asset_receiver=Txn.sender,
// asset_amount=quantity,
// ).submit()
itxn_submit
retsub


// smart_contracts.nft_marketplace.contract.NftMarketplace.withdraw_and_delete() -> void:
withdraw_and_delete:
// smart_contracts/nft_marketplace/contract.py:199-200
// smart_contracts/nft_marketplace/contract.py:196-197
// @arc4.abimethod(allow_actions=["DeleteApplication"])
// def withdraw_and_delete(self) -> None:
proto 0 0
// smart_contracts/nft_marketplace/contract.py:201
// smart_contracts/nft_marketplace/contract.py:198
// assert Txn.sender == Global.creator_address
txn Sender
global CreatorAddress
==
assert
// smart_contracts/nft_marketplace/contract.py:203-207
// itxn.AssetTransfer(
// xfer_asset=self.asset_id,
// asset_receiver=Global.creator_address,
// asset_close_to=Global.creator_address,
// ).submit()
// smart_contracts/nft_marketplace/contract.py:200
// itxn.AssetTransfer(xfer_asset=self.asset_id, asset_receiver=Global.creator_address, asset_close_to=Global.creator_address).submit()
itxn_begin
// smart_contracts/nft_marketplace/contract.py:204
// xfer_asset=self.asset_id,
int 0
byte "asset_id"
app_global_get_ex
assert // check asset_id exists
// smart_contracts/nft_marketplace/contract.py:205
// asset_receiver=Global.creator_address,
global CreatorAddress
// smart_contracts/nft_marketplace/contract.py:206
// asset_close_to=Global.creator_address,
dup
itxn_field AssetCloseTo
itxn_field AssetReceiver
itxn_field XferAsset
// smart_contracts/nft_marketplace/contract.py:203
// itxn.AssetTransfer(
int axfer
itxn_field TypeEnum
// smart_contracts/nft_marketplace/contract.py:203-207
// itxn.AssetTransfer(
// xfer_asset=self.asset_id,
// asset_receiver=Global.creator_address,
// asset_close_to=Global.creator_address,
// ).submit()
itxn_submit
// smart_contracts/nft_marketplace/contract.py:209-212
// itxn.Payment(
// receiver=Global.creator_address,
// close_remainder_to=Global.creator_address,
// ).submit()
// smart_contracts/nft_marketplace/contract.py:201
// itxn.Payment(receiver=Global.creator_address, close_remainder_to=Global.creator_address).submit()
itxn_begin
// smart_contracts/nft_marketplace/contract.py:210
// receiver=Global.creator_address,
global CreatorAddress
// smart_contracts/nft_marketplace/contract.py:211
// close_remainder_to=Global.creator_address,
dup
itxn_field CloseRemainderTo
itxn_field Receiver
// smart_contracts/nft_marketplace/contract.py:209
// itxn.Payment(
int pay
itxn_field TypeEnum
// smart_contracts/nft_marketplace/contract.py:209-212
// itxn.Payment(
// receiver=Global.creator_address,
// close_remainder_to=Global.creator_address,
// ).submit()
itxn_submit
retsub


// smart_contracts.nft_marketplace.contract.NftMarketplace.__init__() -> void:
__init__:
// smart_contracts/nft_marketplace/contract.py:53
// smart_contracts/nft_marketplace/contract.py:45
// def __init__(self) -> None:
proto 0 0
// smart_contracts/nft_marketplace/contract.py:55
// smart_contracts/nft_marketplace/contract.py:47
// self.asset_id = UInt64(0)
byte "asset_id"
int 0
app_global_put
// smart_contracts/nft_marketplace/contract.py:56
// smart_contracts/nft_marketplace/contract.py:48
// self.unitary_price = UInt64(0)
byte "unitary_price"
int 0
app_global_put
// smart_contracts/nft_marketplace/contract.py:57
// smart_contracts/nft_marketplace/contract.py:49
// self.bootstrapped = False
byte "bootstrapped"
int 0
Expand Down
Loading