Skip to content

Commit

Permalink
Merge pull request #189 from aktionariat/176-adapt-version-number-for…
Browse files Browse the repository at this point in the history
…-shares

 update to correct version for shares, add version to draggable
  • Loading branch information
rube-de committed Apr 22, 2024
2 parents 7fab399 + 082147b commit d627a5a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/shares/DraggableShares.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ import "../ERC20/ERC20Permit2.sol";
*/
contract DraggableShares is ERC20Draggable, ERC20Recoverable, ERC20PermitLight, ERC20Permit2 {

// Version history:
// 1: pre permit
// 2: includes permit
// 3: added permit2 allowance, VERSION field
uint8 public constant VERSION = 3;

string public terms;

/// Event when the terms are changed with setTerms().
Expand Down
3 changes: 2 additions & 1 deletion src/shares/Shares.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ contract Shares is ERC20Recoverable, ERC20Named, ERC20PermitLight, ERC20Permit2,
// 1: everything before 2022-07-19
// 2: added mintMany and mintManyAndCall, added VERSION field
// 3: added permit
uint8 public constant VERSION = 3;
// 4: refactor to custom errors, added allowance for permit2
uint8 public constant VERSION = 4;

string public terms;

Expand Down
8 changes: 8 additions & 0 deletions test/test_new_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ describe("New Standard", () => {
it("Should get right claim deleter", async () => {
expect(await shares.getClaimDeleter()).to.equal(owner.address);
});

it("Should give back newest version", async () => {
expect(await shares.VERSION()).to.equal(4);
});
});

describe("Draggable Shares", () => {
Expand All @@ -137,6 +141,10 @@ describe("New Standard", () => {
it("Should get right claim deleter", async () => {
expect(await draggable.getClaimDeleter()).to.equal(oracle.address);
});

it("Should give back newest version", async () => {
expect(await draggable.VERSION()).to.equal(3);
});
});

describe("AllowlistShares", () => {
Expand Down

0 comments on commit d627a5a

Please sign in to comment.