diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..13f15551 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# Basic `dependabot.yml` file with +# minimum configuration for two package managers + +version: 2 +updates: + # Enable version updates for npm + - package-ecosystem: "npm" + # Look for `package.json` and `lock` files in the `root` directory + directory: "/" + # Check the npm registry for updates every day (weekdays) + schedule: + interval: "daily" \ No newline at end of file diff --git a/contracts/upgradeables/governance/MiddlewareStakerNativeTokenV1.sol b/contracts/upgradeables/governance/MiddlewareStakerNativeTokenV1.sol index d50af41d..ad273072 100644 --- a/contracts/upgradeables/governance/MiddlewareStakerNativeTokenV1.sol +++ b/contracts/upgradeables/governance/MiddlewareStakerNativeTokenV1.sol @@ -30,9 +30,9 @@ contract MiddlewareStakerNativeTokenV1 is Initializable, AccessControlUpgradeabl uint256 public totalStaked; uint256 public totalPositions; - event StakedInMiddleware(address indexed user, uint256 indexed poolID, uint256 amount, uint256 positionTokenID, address indexed staker); - event UnstakeInitiatedInMiddleware(address indexed user, uint256 indexed positionTokenID, address indexed staker); - event UnstakedInMiddleware(address indexed user, uint256 indexed positionTokenID, uint256 amount, address indexed staker); + event Staked(address indexed user, uint256 indexed poolID, uint256 amount, uint256 positionTokenID, address indexed staker); + event UnstakeInitiated(address indexed user, uint256 indexed positionTokenID, address indexed staker); + event Unstaked(address indexed user, uint256 indexed positionTokenID, uint256 amount, address indexed staker); error NotYourPosition(address caller); error TransferFailed(); @@ -98,7 +98,7 @@ contract MiddlewareStakerNativeTokenV1 is Initializable, AccessControlUpgradeabl totalStaked += msg.value; totalPositions++; - emit StakedInMiddleware(playerAddress, poolID, msg.value, positionTokenID, msg.sender); + emit Staked(playerAddress, poolID, msg.value, positionTokenID, msg.sender); return positionTokenID; } @@ -109,7 +109,7 @@ contract MiddlewareStakerNativeTokenV1 is Initializable, AccessControlUpgradeabl stakerContract.initiateUnstake(positionTokenID); - emit UnstakeInitiatedInMiddleware(playerAddress, positionTokenID, msg.sender); + emit UnstakeInitiated(playerAddress, positionTokenID, msg.sender); } function unstake(uint256 positionTokenID, address playerAddress) external onlyRole(STAKER_ROLE) nonReentrant whenNotPaused { @@ -127,7 +127,7 @@ contract MiddlewareStakerNativeTokenV1 is Initializable, AccessControlUpgradeabl totalStaked -= position.amount; totalPositions--; - emit UnstakedInMiddleware(playerAddress, positionTokenID, position.amount, msg.sender); + emit Unstaked(playerAddress, positionTokenID, position.amount, msg.sender); } function getUserPositions(address user) external view returns (uint256[] memory) { diff --git a/test/hardhatTests/middlewareStaker.test.ts b/test/hardhatTests/middlewareStaker.test.ts index bab19276..f6fa4bce 100644 --- a/test/hardhatTests/middlewareStaker.test.ts +++ b/test/hardhatTests/middlewareStaker.test.ts @@ -69,7 +69,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { // Find the 'Staked' event // @ts-ignore - const event = events?.find((e) => e.name === 'StakedInMiddleware'); + const event = events?.find((e) => e.name === 'Staked'); return event?.args?.positionTokenID; } @@ -128,7 +128,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { // Find the 'Staked' event // @ts-ignore - const event = events?.find((e) => e.name === 'StakedInMiddleware'); + const event = events?.find((e) => e.name === 'Staked'); expect(event).to.not.be.undefined; const positionTokenID = event!.args.positionTokenID; @@ -168,7 +168,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { .filter((log) => log.address === middlewareStaker.target) .map((log) => middlewareStaker.interface.parseLog(log)); - const event = events.find((e) => e.name === 'UnstakeInitiatedInMiddleware'); + const event = events.find((e) => e.name === 'UnstakeInitiated'); expect(event).to.not.be.undefined; expect(event!.args.user).to.equal(playerAddress); expect(event!.args.positionTokenID).to.equal(positionTokenID); @@ -235,7 +235,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { .filter((log) => log.address === middlewareStaker.target) .map((log) => middlewareStaker.interface.parseLog(log)); - const event1 = events1?.find((e) => e?.name === 'StakedInMiddleware'); + const event1 = events1?.find((e) => e?.name === 'Staked'); expect(event1).to.not.be.undefined; const positionTokenID1 = event1!.args.positionTokenID; @@ -247,7 +247,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { .filter((log) => log.address === middlewareStaker.target) .map((log) => middlewareStaker.interface.parseLog(log)); - const event2 = events2?.find((e) => e?.name === 'StakedInMiddleware'); + const event2 = events2?.find((e) => e?.name === 'Staked'); expect(event2).to.not.be.undefined; const positionTokenID2 = event2!.args.positionTokenID; @@ -299,7 +299,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { .filter((log) => log.address === middlewareStaker.target) .map((log) => middlewareStaker.interface.parseLog(log)); - const event = events?.find((e) => e?.name === 'StakedInMiddleware'); + const event = events?.find((e) => e?.name === 'Staked'); expect(event).to.not.be.undefined; const positionTokenID = event!.args.positionTokenID; @@ -338,7 +338,7 @@ describe('MiddlewareStakerNativeTokenV1', function () { .filter((log) => log.address === middlewareStaker.target) .map((log) => middlewareStaker.interface.parseLog(log)); - const event = events?.find((e) => e?.name === 'StakedInMiddleware'); + const event = events?.find((e) => e?.name === 'Staked'); expect(event).to.not.be.undefined; const positionTokenID = event!.args.positionTokenID;