Skip to content

Commit

Permalink
fix: revert use named return changes (#194)
Browse files Browse the repository at this point in the history
Co-authored-by: Milap Sheth <milap@interoplabs.io>
  • Loading branch information
ahramy and milapsheth authored Oct 25, 2024
1 parent bb1666e commit 819f361
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/fair-trains-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-gmp-sdk-solidity': patch
---

reverted use of named return value in RolesBase to not change bytecode of InterchainToken
10 changes: 7 additions & 3 deletions contracts/utils/RolesBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ contract RolesBase is IRolesBase {
* @param roles The roles to convert
* @return accountRoles The roles in uint256 format
*/
function _toAccountRoles(uint8[] memory roles) internal pure returns (uint256 accountRoles) {
function _toAccountRoles(uint8[] memory roles) internal pure returns (uint256) {
uint256 length = roles.length;
uint256 accountRoles;

for (uint256 i = 0; i < length; ++i) {
accountRoles |= (1 << roles[i]);
}

return accountRoles;
}

/**
Expand All @@ -70,7 +74,7 @@ contract RolesBase is IRolesBase {
* @return key The key of the roles mapping
*/
function _rolesKey(address account) internal view virtual returns (bytes32 key) {
key = keccak256(abi.encodePacked(ROLES_PREFIX, account));
return keccak256(abi.encodePacked(ROLES_PREFIX, account));
}

/**
Expand Down Expand Up @@ -104,7 +108,7 @@ contract RolesBase is IRolesBase {
* @return key The key of the proposed roles mapping
*/
function _proposalKey(address fromAccount, address toAccount) internal view virtual returns (bytes32 key) {
key = keccak256(abi.encodePacked(PROPOSE_ROLES_PREFIX, fromAccount, toAccount));
return keccak256(abi.encodePacked(PROPOSE_ROLES_PREFIX, fromAccount, toAccount));
}

/**
Expand Down

0 comments on commit 819f361

Please sign in to comment.