---
# System prepended metadata

title: 2021/10/28
tags: [BCALI]

---

###### tags: `BCALI`

# 2021/10/28 
### What I did last semester
I was working on the development and operation of the NFT Market.
In the process, I studied the ERC standard and Opensea, so I learned a lot and I'll share it with you.


### ERC721
https://docs.openzeppelin.com/contracts/4.x/api/token/erc721

### Opensea

https://remix.ethereum.org/#version=soljson-v0.4.26+commit.4563c3fc.js&optimize=false&runs=200&evmVersion=null

AtomicMatch
```
function atomicMatch(Order memory buy, Sig memory buySig, Order memory sell, Sig memory sellSig, bytes32 metadata)
{
    check buy side parameter;
    check sell order is valid;(expirationTime, signature)
    check sell order is not cancelled or finalized;
    transfer sell price(ETH or ERC20) to seller;
    transfer fee to Opensea;
    transfer NFT from seller to buyer;
    emit event;
}
```

OPENSTORE
```
function safeTransferFrom(
    address _from,
    address _to,
    uint256 _id,
    uint256 _amount,
    bytes memory _data
) public {
    uint256 mintedBalance = super.balanceOf(_from, _id);
    if (mintedBalance < _amount) {
        // Only mint what _from doesn't already have
        mint(_to, _id, _amount.sub(mintedBalance), _data);
        if (mintedBalance > 0) {
            super.safeTransferFrom(_from, _to, _id, mintedBalance, _data);
        }
    } else {
        super.safeTransferFrom(_from, _to, _id, _amount, _data);
    }
}
```

### EX
* I want it to be impossible to resell. I want a mechanism to ban accounts/assets that have violations from the operating account, and other requests that are fundamentally incompatible with blockchain.

    * Sometimes there is business-like security.
    * I realize my lack of basic knowledge.I realize my lack of basic knowledge.