Skip to content

Instantly share code, notes, and snippets.

View sparrowDom's full-sized avatar

Domen Grabec sparrowDom

  • Origin Protocol
  • Slovenia
View GitHub Profile
# The Quesstion was:
I would like to remove all the functionality of doing:
- no changes to OUSD
- no bridging of OTokens
Just keep the functionality to replace the OETHb Bridged strategy so with the change it still has master strategy on Base and remote strategy on Mainnet. All other funcitonality can be removed.
What percentage of code / complexity can be removed?
# PR #2909 — OETHb-only trim analysis
@sparrowDom
sparrowDom / gist:440e5e2aa7da41a561856536bbd5819d
Created December 22, 2025 09:27
Tenderly extract message hash
javascript:(function(){if(!window.location.toString().match("^https://dashboard.tenderly.co/")){throw new Error("Potential phishing detected. Url doesn't match dashboard tenderly")}var aTags=document.getElementsByTagName("span");var searchText="encodeTransactionData";var encDataElement;for(var i=0;i<aTags.length;i++){if(aTags[i].textContent==searchText){encDataElement=aTags[i];break}}if(!encDataElement){throw new Error("Can not find 'encodeTransactionData' span element")}const parentSpans=encDataElement.parentElement.getElementsByTagName('span');let valElement=null;for(let j=0;j<parentSpans.length;j++){if(parentSpans[j].textContent.length===134){valElement=parentSpans[j];break}}if(!valElement){throw new Error("Can not find the element that displays the output value of 'encodeTransactionData'")}const returnValue=valElement.textContent;alert(`Message hash of the transaction: 0x${returnValue.substring(returnValue.length-64)}`)})();
int32[] memory ticks = new int32[](1);
uint128[] memory relativeLiquidityAmounts = new uint128[](1);
ticks[0] = -1;
// all liquidity into one tick
relativeLiquidityAmounts[0] = 1e18;
uint256 maxAmountA = 1e18;
// see documentation: https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/interfaces/imaverickv2poollens#addparamsspecification
IMaverickV2PoolLens.AddParamsSpecification memory addSpec = IMaverickV2PoolLens.AddParamsSpecification({
slippageFactorD18: 0.01e18,
int32[] memory ticks = new int32[](1);
uint128[] memory relativeLiquidityAmounts = new uint128[](1);
ticks[0] = -1;
// all liquidity into one tick
relativeLiquidityAmounts[0] = 1e18;
uint256 maxAmountA = 1e18;
// see documentation: https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/interfaces/imaverickv2poollens#addparamsspecification
IMaverickV2PoolLens.AddParamsSpecification memory addSpec = IMaverickV2PoolLens.AddParamsSpecification({
slippageFactorD18: 0.01e18,
javascript:(function(){
if (!window.location.toString().match("^https://dashboard.tenderly.co/")) {
throw new Error("Potential phishing detected. Url doesn't match dashboard tenderly")
}
var aTags = document.getElementsByTagName("span");
var searchText = "encodeTransactionData";
var encDataElement;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == searchText) {
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 16 columns, instead of 8 in line 3.
,action,action_mix,pre_pool_0,pre_pool_1,before_pool_0,before_pool_1,pre_vault,before_vault,before_otoken,pool_before_check_balance,after_pool_0,after_pool_1,after_vault,after_otoken,pool_after_check_balance
0,checkBalance,-1.0,50404822629676069580924,61665613047767922978486,50404822629676069580924,61665613047767922978486,62629094379125364028049443,62629094379125364028049443,57628980682074191609491287,111167517140187695089976,152082182814939917,5061165613047767922978486,72629094379125364028103150,72629094379125364028049443,111167517140187695143683
1,checkBalance,-0.95,50404822629676069580924,61665613047767922978486,50404822629676069580924,61665613047767922978486,62629094379125364028049443,62629094379125364028049443,57628980682074191609491287,111167517140187695089976,177040363655438645,4811190613047767922978486,72629094379125364028099212,72629094379125364028049443,111167517140187695139745
2,checkBalance,-0.9,50404822629676069580924,61665613047767922978486,50404822629676069580924,61665613047767922978486,6262909
This file has been truncated, but you can view the full file.
{
"data": {
"gauges": [
{
"id": "0x016889e5e0f026c030d28321f3190a39206120ad",
"pool": null,
"ichiVault": {
"id": "0x1a89f32b3140e9fb8636054de7a90069635f268e",
"depositToken": {
"id": "0xb1e25689d55734fd3fffc939c4c3eb52dff8a794",
javascript:(function(){
if (!window.location.toString().match("^https://dashboard.tenderly.co/")) {
throw new Error("Potential phishing detected. Url doesn't match dashboard tenderly")
}
var aTags = document.getElementsByTagName("span");
var searchText = "encodeTransactionData";
var encDataElement;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == searchText) {
javascript:(function(){
var aTags = document.getElementsByTagName("span");
var searchText = "encodeTransactionData";
var encDataElement;
for (var i = 0; i < aTags.length; i++) {
if (aTags[i].textContent == searchText) {
encDataElement = aTags[i];
break;
}
}
@sparrowDom
sparrowDom / PoolBoosterSwapxDoubleAbi.json
Created February 25, 2025 09:47
PoolBoosterSwapxDoubleAbi.json
[
{
"inputs": [
{
"internalType": "address",
"name": "_bribeContractOS",
"type": "address"
},
{
"internalType": "address",