Buy, Sell, and Auction off items on a decentralized marketplace.
The code reviewed by New Alchemy is in the GitHub repository (https://github.com/LootSafe/lootsafe.marketplace.contracts) at commit hash d87b8c89a8851971c90248e8b5415137320053d6.
contracts/Market.sol ac147a333fe9b08067bb41e63fd425ecaed2e92b
contracts/Migrations.sol 19a7c00c1123db1875e307e7186c323b4092434b
contracts/Vault.sol 56cde2b4bfeb365e43a9667037f39f3c56e1c0f3
contracts/lib/Cellar.sol 3479c87b345a616bd64df157520402b64ecea254
contracts/lib/EIP20.sol f74bcd48457fa08f890beb394b3dd5009b4a026a
contracts/lib/EIP20Interface.sol 3daf1c7e479a85f6a1b3e230429f568c081e4bcd
Full Audit LootSafe Smart Contract Audit v1.0.pdf
Market.listing_ids() view 289aa130
Inputs
| type | name | description |
|---|---|---|
| uint256 | undefined |
Market.market_events() view 2b039d91
Market.fulfill_listing(id) nonpayable 361d8a3f
**Fulfill a listing and purchase merchants asset **
Inputs
| type | name | description |
|---|---|---|
| uint256 | id | Id of the listing to fulfil |
|
Market.create_listing(asset, amount, value) nonpayable 389b0dc4
**Create a listing on the marketplace **
Inputs
| type | name | description |
|---|---|---|
| address | asset | Address of asset to sell |
| | uint256 | amount | Amount of asset to sell | | uint256 | value | How much to sell asset for |
Market.base() view 5001f3b5
Market.my_vault() view 5b680349
**Get the address of senders vault **
Market.get_listings() view 65c4c884
**Get all listing ids **
Outputs
| type | name | description |
|---|---|---|
| uint256[] | undefined |
Market.owner() view 8da5cb5b
Market.vaults() view a622ee7c
Inputs
| type | name | description |
|---|---|---|
| address | undefined |
Market.listings() view de74e57b
Inputs
| type | name | description |
|---|---|---|
| uint256 | undefined |
Market.cancel_listing(id) nonpayable e4e0dd77
**Cancel a listing and unlock assets **
Inputs
| type | name | description |
|---|---|---|
| uint256 | id | Id of listing to cancel |
|
Market.get_listing(id) view fed69702
**Get a listing by id **
Inputs
| type | name | description |
|---|---|---|
| uint256 | id | undefined |
Outputs
| type | name | description |
|---|---|---|
| uint256 | undefined | |
| uint256 | undefined | |
| address | undefined | |
| address | undefined | |
| uint256 | undefined | |
| uint256 | undefined | |
| uint256 | undefined |
Vault.withdrawal(asset, value) nonpayable 5a6b26ba
**Allow withdraw of non-locked funds **
Inputs
| type | name | description |
|---|---|---|
| address | asset | The asset the merchant want's to withdraw |
| | uint256 | value | The amount of asset to be transferred |
Vault.parent() view 60f96a8f
Vault.lock_asset(asset, amount) nonpayable 69fb03b5
**Lock assets from withdraw **
Inputs
| type | name | description |
|---|---|---|
| address | asset | Address of asset to be locked up |
| | uint256 | amount | Amount of asset to lock up |
Vault.ether_saver() nonpayable 760c84fd
**redeem accidental ETH sent to the contract **
Vault.has_balance(asset, value) nonpayable 870d0b84
**Check balances of assets **
Inputs
| type | name | description |
|---|---|---|
| address | asset | Address of asset to check balance of |
| | uint256 | value | Value expected to have |
Vault.unlock_asset(asset, amount) nonpayable a48cb6d7
**Unlock assets from withdraw **
Inputs
| type | name | description |
|---|---|---|
| address | asset | Address of asset to be unlocked |
| | uint256 | amount | Amount of asset to unlocked |
Vault.merchant() view a5ff7651
Vault.transfer(to, asset, value) nonpayable beabacc8
**Allow the creator to run transfers of assets **
Inputs
| type | name | description |
|---|---|---|
| address | to | The address to transfer to |
| | address | asset | The asset to transfer | | uint256 | value | The amount of asset to be transferred |
EIP20Interface.approve(_spender, _value) nonpayable 095ea7b3
**msg.sender approves _spender to spend _value tokens
**
Inputs
| type | name | description |
|---|---|---|
| address | _spender | The address of the account able to transfer the tokens |
| | uint256 | _value | The amount of tokens to be approved for transfer |
Outputs
| type | name | description |
|---|---|---|
| bool | success | undefined |
EIP20Interface.totalSupply() view 18160ddd
EIP20Interface.transferFrom(_from, _to, _value) nonpayable 23b872dd
**send _value token to _to from _from on the condition it is approved by _from
**
Inputs
| type | name | description |
|---|---|---|
| address | _from | The address of the sender |
| | address | _to | The address of the recipient | | uint256 | _value | The amount of token to be transferred |
Outputs
| type | name | description |
|---|---|---|
| bool | success | undefined |
EIP20Interface.balanceOf(_owner) nonpayable 70a08231
Inputs
| type | name | description |
|---|---|---|
| address | _owner | The address from which the balance will be retrieved |
|
Outputs
| type | name | description |
|---|---|---|
| uint256 | balance | undefined |
EIP20Interface.transfer(_to, _value) nonpayable a9059cbb
**send _value token to _to from msg.sender
**
Inputs
| type | name | description |
|---|---|---|
| address | _to | The address of the recipient |
| | uint256 | _value | The amount of token to be transferred |
Outputs
| type | name | description |
|---|---|---|
| bool | success | undefined |
EIP20Interface.allowance(_owner, _spender) nonpayable dd62ed3e
Inputs
| type | name | description |
|---|---|---|
| address | _owner | The address of the account owning tokens |
| | address | _spender | The address of the account able to transfer the tokens |
Outputs
| type | name | description |
|---|---|---|
| uint256 | remaining | undefined |
EIP20Interface.Transfer(_from, _to, _value) ddf252ad
Arguments
| type | name | description |
|---|---|---|
| address | _from | indexed |
| address | _to | indexed |
| uint256 | _value | not indexed |
EIP20Interface.Approval(_owner, _spender, _value) 8c5be1e5
Arguments
| type | name | description |
|---|---|---|
| address | _owner | indexed |
| address | _spender | indexed |
| uint256 | _value | not indexed |
MarketEvents.listing_fulfilled(id, buyer) nonpayable 30f27e2f
Inputs
| type | name | description |
|---|---|---|
| uint256 | id | undefined |
| address | buyer | undefined |
MarketEvents.listing_cancelled(id) nonpayable 5efca922
Inputs
| type | name | description |
|---|---|---|
| uint256 | id | undefined |
MarketEvents.market() view 80f55605
MarketEvents.listing_created(merchant, id) nonpayable 9448875f
Inputs
| type | name | description |
|---|---|---|
| address | merchant | undefined |
| uint256 | id | undefined |
MarketEvents.vault_created(merchant, vault) nonpayable db5bca90
Inputs
| type | name | description |
|---|---|---|
| address | merchant | undefined |
| address | vault | undefined |
MarketEvents.VaultCreated(merchant, vault) 5d9c31ff
Arguments
| type | name | description |
|---|---|---|
| address | merchant | not indexed |
| address | vault | not indexed |
MarketEvents.ListingCreated(merchant, id) f060b874
Arguments
| type | name | description |
|---|---|---|
| address | merchant | not indexed |
| uint256 | id | not indexed |
MarketEvents.ListingFulfilled(id, buyer) d09f1e54
Arguments
| type | name | description |
|---|---|---|
| uint256 | id | not indexed |
| address | buyer | not indexed |
MarketEvents.ListingCancelled(id) 411aee90
Arguments
| type | name | description |
|---|---|---|
| uint256 | id | not indexed |