-
Notifications
You must be signed in to change notification settings - Fork 0
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
OwnerData contract supporting Yoko Ono artwork #31
Conversation
Please add a batch processing ability for updating records for the first owner, so we can probably batch the request later if needed. |
ee72761
to
735a1a0
Compare
Please change the base branch to master. |
93c5259
to
7423e07
Compare
6aa764a
to
7423e07
Compare
7423e07
to
6bffb9f
Compare
0d23a3f
to
49e5ef4
Compare
For deleting, let's just replace the records with empty data. Then we won't need to sort. |
contracts/OwnerData.sol
Outdated
return result; | ||
} | ||
|
||
function remove(address contractAddress_, uint256 tokenID_, uint256[] calldata indexes_) external { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the permissions to delete here.
contracts/OwnerData.sol
Outdated
string private constant SIGNED_MESSAGE = "Authorize to write your data to the contract"; | ||
address private immutable _signer; | ||
address private immutable _costReceiver; | ||
uint256 public cost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint256 public cost; | |
uint256 public serviceFee; |
contracts/OwnerData.sol
Outdated
event DataAdded(address indexed contractAddress, uint256 indexed tokenID, Data data); | ||
|
||
error TrusteeIsZeroAddress(); | ||
error CostReceiverIsZeroAddress(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error CostReceiverIsZeroAddress(); | |
error EmptyServiceFeeReceiver(); |
contracts/OwnerData.sol
Outdated
error InvalidSignature(); | ||
|
||
|
||
constructor(address signer_, address costReceiver_, uint256 cost_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor(address signer_, address costReceiver_, uint256 cost_) { | |
constructor(address signer_, address serviceFeeReceiver_, uint256 serviceFee_) { |
e9c8226
to
1640a55
Compare
contracts/OwnerData.sol
Outdated
_addData(account, contractAddress_, tokenID_, data_); | ||
} | ||
|
||
function _addData(address sender_, address contractAddress_, uint256 tokenID_, Data memory data_) private { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add bool isPublicToken_
so we don't have to read from storage again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we still need to read and verify, no?
Or we can set it immutable.
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.13; | ||
|
||
import "@openzeppelin/contracts/utils/Context.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global import of path @openzeppelin/contracts/utils/Context.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; | ||
import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; | ||
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; | ||
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global import of path @openzeppelin/contracts/utils/structs/EnumerableSet.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
|
||
string private constant SIGNED_MESSAGE = | ||
"Authorize to write your data to the contract"; | ||
uint256 public immutable publicToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Immutable variables name are set to be in capitalized SNAKE_CASE
error OwnerDataAlreadyAdded(); | ||
error InvalidSignature(); | ||
|
||
constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explicitly mark visibility in function (Set ignoreConstructors to true if using solidity >=0.7.0)
3dba2eb
to
d5082ce
Compare
Story link:
https://github.com/bitmark-inc/feral-file/issues/1953