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

fix: revert use named return changes #194

Merged
merged 5 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]/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
Loading