diff --git a/src/ecosys/definition.yml b/src/ecosys/definition.yml index a5d65dc..e9d1078 100644 --- a/src/ecosys/definition.yml +++ b/src/ecosys/definition.yml @@ -43,3 +43,8 @@ features: approve: disable: - ring + +safepin: + 46: # darwinia + safeTxGas: 613599 + gasPrice: 154000000000 diff --git a/src/ecosys/safe.js b/src/ecosys/safe.js index 5d5f796..563f7db 100644 --- a/src/ecosys/safe.js +++ b/src/ecosys/safe.js @@ -80,11 +80,13 @@ async function initSafe(options) { } -export async function propose(options = {safeSdk, safeService, transactions, safeAddress, senderAddress}) { - const {safeSdk, safeService, transactions, safeAddress, senderAddress} = options; +export async function propose(options = {definition, safeSdk, safeService, transactions, safeAddress, senderAddress}) { + const {definition, safeSdk, safeService, transactions, safeAddress, senderAddress} = options; const chainId = await safeSdk.getChainId(); const remoteNonce = await safeSdk.getNonce(); + const safepin = definition.safepin[chainId]; + let nonce; if (cachedNonce[chainId]) { const cnonce = cachedNonce[chainId]; @@ -93,11 +95,13 @@ export async function propose(options = {safeSdk, safeService, transactions, saf nonce = remoteNonce; } + let createTransactionOptions = { nonce }; + if (safepin) { + createTransactionOptions = {...createTransactionOptions, ...safepin}; + } const safeTransaction = await safeSdk.createTransaction({ transactions, - options: { - nonce, - }, + options: createTransactionOptions, }); const safeTxHash = await safeSdk.getTransactionHash(safeTransaction); const senderSignature = await safeSdk.signTransaction(safeTransaction); diff --git a/src/register/lnv2_default.js b/src/register/lnv2_default.js index 1e51d79..255e155 100644 --- a/src/register/lnv2_default.js +++ b/src/register/lnv2_default.js @@ -193,6 +193,7 @@ async function registerWithSafe(options, callOptions) { if (p0Transactions.length) { const p0 = await safe.propose({ + definition, safeSdk: targetSafeSdk, safeService: targetSafeService, safeAddress: register.safeWalletAddress, @@ -225,6 +226,7 @@ async function registerWithSafe(options, callOptions) { } const p1 = await safe.propose({ + definition, safeSdk: sourceSafeSdk, safeService: sourceSafeService, safeAddress: register.safeWalletAddress, diff --git a/src/register/lnv2_opposite.js b/src/register/lnv2_opposite.js index 7526be2..6e9fd61 100644 --- a/src/register/lnv2_opposite.js +++ b/src/register/lnv2_opposite.js @@ -134,6 +134,7 @@ async function registerWithSafe(options, callOptions) { if (p0Transactions.length) { const p0 = await safe.propose({ + definition, safeSdk: targetSafeSdk, safeService: targetSafeService, safeAddress: register.safeWalletAddress, @@ -150,6 +151,7 @@ async function registerWithSafe(options, callOptions) { } const p1 = await safe.propose({ + definition, safeSdk: sourceSafeSdk, safeService: sourceSafeService, safeAddress: register.safeWalletAddress, diff --git a/src/register/lnv3.js b/src/register/lnv3.js index 806dad9..7108956 100644 --- a/src/register/lnv3.js +++ b/src/register/lnv3.js @@ -178,6 +178,7 @@ async function registerWithSafe(options, callOptions) { } const p0 = await safe.propose({ + definition, safeSdk: sourceSafeSdk, safeService: sourceSafeService, safeAddress: register.safeWalletAddress,