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

WIP: Create the first version of Billboard contracts #119

Closed
wants to merge 13 commits into from
Closed

Conversation

zeckli
Copy link
Contributor

@zeckli zeckli commented Oct 31, 2023

Create the basic version of Billboard contracts:

  • Billboard.sol
  • BillboardAuction.sol
  • BillboardRegistry.sol

string description;
string location;
string contentURI;
string redirectLink;
Copy link
Contributor

Choose a reason for hiding this comment

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

redirectURI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.


/// @inheritdoc IBillboard
function setIsOpened(bool value_) external isAdmin(msg.sender) {
if (address(registry) == address(0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

L61-L66 can use isValidAddress instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

or we don't need L61-L66 actually since the transaction will be failed if registry or auction are zero addresses.

Copy link
Contributor Author

@zeckli zeckli Nov 7, 2023

Choose a reason for hiding this comment

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

You're right tx will be failed. Removed L61-L66.

modifier isValidBoard(uint256 tokenId_) {
uint256 latestId = tokenIds.current();

if (tokenId_ < 1 || tokenId_ > latestId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is L49, then this is no needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove the first validation since ownership checker is added

assertEq(operatorAddress, registry.operator());

operator.upgradeAuction(address(auction));
operator.upgradeRegistry(address(registry));
Copy link
Contributor

Choose a reason for hiding this comment

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

assetEq to check operator.auction and operator.registry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added assertion for auction and registry upgradability

}

modifier isFromOperator() {
if (operator == address(0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Zero address checkers (L62-L67) seem unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

}

modifier isFromOperator() {
if (operator == address(0)) {
Copy link
Contributor

@robertu7 robertu7 Nov 7, 2023

Choose a reason for hiding this comment

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

Zero address checkers (L83-L88) seem unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

assertEq("", board.description);
assertEq("", board.location);
assertEq("", board.contentURI);
assertEq("", board.redirectLink);
Copy link
Contributor

@robertu7 robertu7 Nov 7, 2023

Choose a reason for hiding this comment

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

test mint more than one token and check sequential token id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added one more minting test case.

//////////////////////////////

struct Board {
address owner;
Copy link
Contributor

Choose a reason for hiding this comment

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

i was thinking that maybe owner is not a good name since it's easily confused with token.ownerOf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rename owner to creator (better than minter).

@robertu7
Copy link
Contributor

forked to #120

@robertu7 robertu7 closed this Nov 21, 2023
@gitwoz gitwoz deleted the billboard branch August 29, 2024 04:15
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.

2 participants