su-squares / ethereum-contract

Su Squares smart contract and bounty program

Home Page:https://tenthousandsu.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operator Send does not use correct check

fulldecent opened this issue · comments

https://github.com/su-squares/ethereum-contract/blob/master/contracts/SuNFT.sol#L48

modifier canTransfer(uint256 _tokenId) {
    // assert(msg.sender != address(this))
    address owner = _tokenOwnerWithSubstitutions[_tokenId];
    require(msg.sender == owner ||
      msg.sender == tokenApprovals[_tokenId] ||
      operatorApprovals[msg.sender][msg.sender]);
    _;
}

should be

modifier canTransfer(uint256 _tokenId) {
    // assert(msg.sender != address(this))
    address owner = _tokenOwnerWithSubstitutions[_tokenId];
    require(msg.sender == owner ||
      msg.sender == tokenApprovals[_tokenId] ||
      operatorApprovals[owner][msg.sender]);
    _;
}

Credit goes to dfinzer at OpenSea! Thanks for your help.