Skip to content

Commit

Permalink
separate rgb of representment
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Jan 13, 2024
1 parent bfe40e1 commit 555298c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/evm/src/examples/RepresentmentToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract contract ILRTARepresentmentToken is ILRTA {
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3*/

struct Data {
uint24[8][8] rgb;
uint256[8][8][3] rgb;
}

struct ILRTAData {
Expand Down Expand Up @@ -103,10 +103,12 @@ abstract contract ILRTARepresentmentToken is ILRTA {
if (_dataOf[from].hash != keccak256(abi.encode(fromData))) revert InvalidDataHash();
if (_dataOf[to].hash != keccak256(abi.encode(toData))) revert InvalidDataHash();

for (uint256 i; i < 8; i++) {
for (uint256 j; j < 8; j++) {
fromData.rgb[i][j] -= transferDetails.transferData.rgb[i][j];
toData.rgb[i][j] += transferDetails.transferData.rgb[i][j];
for (uint256 i = 0; i < 8; i++) {
for (uint256 j = 0; j < 8; j++) {
for (uint256 l = 0; l < 3; l++) {
fromData.rgb[i][j][l] -= transferDetails.transferData.rgb[i][j][l];
toData.rgb[i][j][l] += transferDetails.transferData.rgb[i][j][l];
}
}
}

Expand Down

0 comments on commit 555298c

Please sign in to comment.