Skip to content

Commit d380ac5

Browse files
committed
Problem: avoid Derived contract must override function _contextSuffixLength error
1 parent e85528e commit d380ac5

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

contracts/external-deps/openzeppelin/metatx/ERC2771Context.sol

+4
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ abstract contract ERC2771Context is Context {
4141
}
4242

4343
uint256[49] private __gap;
44+
45+
function _contextSuffixLength() internal view virtual returns (uint256) {
46+
return 20;
47+
}
4448
}

contracts/infra/TWFactory.sol

+4
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,8 @@ contract TWFactory is Multicall, ERC2771Context, AccessControlEnumerable, IContr
137137
function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) {
138138
return ERC2771Context._msgData();
139139
}
140+
141+
function _contextSuffixLength() internal view virtual override(ERC2771Context, Context) returns (uint256) {
142+
return ERC2771Context._contextSuffixLength();
143+
}
140144
}

contracts/infra/TWRegistry.sol

+4
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,8 @@ contract TWRegistry is Multicall, ERC2771Context, AccessControlEnumerable {
6767
function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) {
6868
return ERC2771Context._msgData();
6969
}
70+
71+
function _contextSuffixLength() internal view virtual override(ERC2771Context, Context) returns (uint256) {
72+
return ERC2771Context._contextSuffixLength();
73+
}
7074
}

0 commit comments

Comments
 (0)