Skip to content

Conversation

@ihooni
Copy link
Collaborator

@ihooni ihooni commented Nov 3, 2025

Description

This PR introduces semantic versioning to all Dojang contracts to improve version tracking and maintainability.
Each contract now exposes a version() function.

In addition, upgrade script has been added that performs contracts upgrades only when the semantic version has changed, ensuring cleaner and more intentional upgrade processes.

Related Issue

Closes #5

@ihooni ihooni self-assigned this Nov 3, 2025
Copy link
Collaborator Author

@ihooni ihooni left a comment

Choose a reason for hiding this comment

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

After approved, i'll upload broadcast files for GIWA Sepolia

Comment on lines +70 to +73
(bool success,) = proxy.staticcall(abi.encodeWithSelector(ISemver.version.selector));
if (!success) {
return true;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if version() interface is not implemented, needs to upgrade.

Comment on lines +67 to +68
(VmSafe.CallerMode m,,) = vm.readCallers();
require(m == VmSafe.CallerMode.None, "Only offchain");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ensure that this function should be simulated, not broadcast.

@ihooni ihooni marked this pull request as ready for review November 3, 2025 13:00
@Jaden-dunamu Jaden-dunamu requested a review from Copilot November 4, 2025 04:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces semantic versioning to all Dojang contracts using a standardized ISemver interface and version string format. The implementation enables version-aware contract upgrades through an automated upgrade script that checks semantic version differences.

  • Added ISemver interface defining a standard version() function returning string
  • Updated all contracts to implement semantic versioning with "0.2.0" version
  • Created upgrade infrastructure with version comparison logic to prevent unnecessary upgrades

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/interfaces/ISemver.sol New interface defining semantic versioning standard
src/SchemaBook.sol Added ISemver implementation with version "0.2.0"
src/DojangScroll.sol Added ISemver implementation with version "0.2.0"
src/DojangAttesterBook.sol Added ISemver implementation with version "0.2.0"
src/BalanceDojangResolver.sol Moved version function and updated to semantic versioning
src/AttestationIndexer.sol Added ISemver implementation with version "0.2.0"
src/AddressDojangResolver.sol Moved version function and updated to semantic versioning
script/utils/DeployConfig.s.sol New utility for reading deployment configuration
script/upgrade/Upgrade.s.sol New upgrade script with semantic version comparison
package.json Updated package version to match contract versions
foundry.toml Added filesystem permissions for deploy config
deploy-config/91342.json New deployment configuration for testnet
test files Updated test assertions to match new version strings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ihooni ihooni merged commit b421162 into main Nov 4, 2025
3 checks passed
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.

add semantic versioning to contracts

5 participants