Comments (4)
Hi, @rmeissner
I am also facing this problem, do you have any solution or advise on this ?
from safe-smart-account.
Will not be fixed: #197
from safe-smart-account.
I had a weird brainfart and struggled to understand the example calculations, so I'll leave some details for a future reference:
- The gas price in a token is calculated as
gwei_price * 1_eth_to_token_ratio
- In the example
1_eth_to_token_ratio
would be100
, 1 ETH = 100 LOVE - The result is
5 * 10^11
My biggest problem was understanding where 1e12
came from. If we use uniswap, then the price 1_eth_to_token_ratio
would be calculated as:
price = love_reserves / eth_reserves
where love_reserves
and eth_reserves
are in their smallest denomination; therefore, if we want to get to their largest denomination, every reserve has to be divided by 10 ^ token_decimals
, so we get 10 ^ 6 / 10 ^ 18
, which turns into 10 ^ -12
.
The example calculation is in the largest denomination, so to get to the smallest, we need to multiply it by 10 ^ -12
which is the same as dividing by 10 ^ 12
from safe-smart-account.
if you send tokenGasPrice multiplied by a factor say 1e18 and update handlePayment to divide by this fixed number then it solves the problem.
we tried to keep variable tokenGasPriceFactor but fixed high value also makes sense.
from safe-smart-account.
Related Issues (20)
- Extend Safe With Additional Signing Schemes HOT 2
- Add an `ISafe` Interface For Interacting with Safes
- Bug report
- ,
- [Safe 1.5.0] Evaluate Posibility of moving `checkSignatures(bytes32, bytes, bytes)` into `Safe` HOT 3
- [Safe 1.5.0] `execTransactionFromModuleReturnData` Will Return Guard `returndata` HOT 3
- Provide developer utils for foundry
- Fallback function could be made payable.
- Evaluate strategies for reducing Safe code size
- Provide a way to identify whether a contract is a SAFE. HOT 1
- Expose revert message when internal transaction fails and `safeTxGas`/`gasPrice` are 0
- ProviderError: not enough gas supplied for intrinsic gas costs HOT 2
- Rename the repo to `safe-smart-account` HOT 5
- Technical background for `onlyNonceZero` in `SafeToL2Migration`? HOT 6
- JSON Mix Up
- Figure out why Safe can't compile on 0.8 with IR optimizations HOT 2
- Imports Ordering for Contracts HOT 2
- Using `returndatasize()` directly in assembly HOT 1
- Compilation fails with solc 0.8.23 HOT 4
- LZ's `sendFrom()` produces insufficient gas error in tx simulation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from safe-smart-account.