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

Modify IA storage slot on proxies #187

Merged
merged 2 commits into from
Feb 12, 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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Change Log
All notable changes to this project will be documented in this file.

## [4.1.3]

### Update

- **AbstractProxy**: updated the storage slot for `TREXImplementationAuthority` from
`0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7` to
`0x821f3e4d3d679f19eacc940c87acf846ea6eae24a63058ea750304437a62aafc` to avoid issues with blockchain explorers
confusing the proxy pattern of T-REX for an ERC-1822 proxy (old storage slot was the slot used by ERC-1822) which
caused errors in displaying the right ABIs for proxies using this implementation.

## [4.1.2]
- **Compliance Modules**:
- Removed `_compliance` parameter from `setSupplyLimit` function of the `SupplyLimitModule`
Expand Down
7 changes: 4 additions & 3 deletions contracts/proxy/AbstractProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,19 @@ abstract contract AbstractProxy is IProxy, Initializable {
address implemAuth;
// solhint-disable-next-line no-inline-assembly
assembly {
implemAuth := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7)
implemAuth := sload(0x821f3e4d3d679f19eacc940c87acf846ea6eae24a63058ea750304437a62aafc)
}
return implemAuth;
}

/**
* @dev store the implementationAuthority contract address using the ERC-1822 implementation slot in storage
* @dev store the implementationAuthority contract address using the ERC-3643 implementation slot in storage
* the slot storage is the result of `keccak256("ERC-3643.proxy.beacon")`
*/
function _storeImplementationAuthority(address implementationAuthority) internal {
// solhint-disable-next-line no-inline-assembly
assembly {
sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, implementationAuthority)
sstore(0x821f3e4d3d679f19eacc940c87acf846ea6eae24a63058ea750304437a62aafc, implementationAuthority)
}
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/token/TokenStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract TokenStorage {
string internal _tokenSymbol;
uint8 internal _tokenDecimals;
address internal _tokenOnchainID;
string internal constant _TOKEN_VERSION = "4.1.1";
string internal constant _TOKEN_VERSION = "4.1.3";

/// @dev Variables of freeze and pause functions
mapping(address => bool) internal _frozen;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tokenysolutions/t-rex",
"version": "4.1.2",
"version": "4.1.3",
"description": "A fully compliant environment for the issuance and use of tokenized securities.",
"main": "index.js",
"directories": {
Expand Down
Loading