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

OwnerData contract supporting Yoko Ono artwork #31

Closed
wants to merge 16 commits into from

Conversation

tienngovan
Copy link
Contributor

@anhnguyenbitmark
Copy link
Member

Please add a batch processing ability for updating records for the first owner, so we can probably batch the request later if needed.

@tienngovan tienngovan changed the base branch from main to contract-v5 February 23, 2024 09:31
@anhnguyenbitmark
Copy link
Member

Please change the base branch to master.

@tienngovan tienngovan changed the base branch from contract-v5 to main February 28, 2024 08:54
contracts/OwnerData.sol Show resolved Hide resolved
contracts/OwnerData.sol Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
@tienngovan tienngovan changed the title Implemented OwnerData contract OwnerData contract support Yoko Ono artwork Feb 28, 2024
@tienngovan tienngovan changed the title OwnerData contract support Yoko Ono artwork OwnerData contract supporting Yoko Ono artwork Feb 28, 2024
contracts/OwnerData.sol Show resolved Hide resolved
contracts/OwnerData.sol Show resolved Hide resolved
contracts/OwnerData.sol Show resolved Hide resolved
contracts/OwnerData.sol Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
@tienngovan tienngovan force-pushed the feature/owner-data-contract branch 2 times, most recently from 0d23a3f to 49e5ef4 Compare March 3, 2024 06:20
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
contracts/OwnerData.sol Outdated Show resolved Hide resolved
@anhnguyenbitmark
Copy link
Member

For deleting, let's just replace the records with empty data. Then we won't need to sort.

return result;
}

function remove(address contractAddress_, uint256 tokenID_, uint256[] calldata indexes_) external {
Copy link
Member

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.

string private constant SIGNED_MESSAGE = "Authorize to write your data to the contract";
address private immutable _signer;
address private immutable _costReceiver;
uint256 public cost;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uint256 public cost;
uint256 public serviceFee;

event DataAdded(address indexed contractAddress, uint256 indexed tokenID, Data data);

error TrusteeIsZeroAddress();
error CostReceiverIsZeroAddress();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error CostReceiverIsZeroAddress();
error EmptyServiceFeeReceiver();

error InvalidSignature();


constructor(address signer_, address costReceiver_, uint256 cost_) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
constructor(address signer_, address costReceiver_, uint256 cost_) {
constructor(address signer_, address serviceFeeReceiver_, uint256 serviceFee_) {

contracts/OwnerData.sol Outdated Show resolved Hide resolved
@tienngovan tienngovan force-pushed the feature/owner-data-contract branch 2 times, most recently from e9c8226 to 1640a55 Compare March 8, 2024 02:28
_addData(account, contractAddress_, tokenID_, data_);
}

function _addData(address sender_, address contractAddress_, uint256 tokenID_, Data memory data_) private {
Copy link
Contributor

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.

Copy link
Member

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.

@bitmark-inc bitmark-inc deleted a comment from github-actions bot Mar 11, 2024
@bitmark-inc bitmark-inc deleted a comment from github-actions bot Mar 11, 2024
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import "@openzeppelin/contracts/utils/Context.sol";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [solhint] reported by reviewdog 🐶
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";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [solhint] reported by reviewdog 🐶
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [solhint] reported by reviewdog 🐶
Immutable variables name are set to be in capitalized SNAKE_CASE

error OwnerDataAlreadyAdded();
error InvalidSignature();

constructor(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [solhint] reported by reviewdog 🐶
Explicitly mark visibility in function (Set ignoreConstructors to true if using solidity >=0.7.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants