Last active
April 23, 2024 11:25
-
-
Save arcticfloyd1984/8722f7286c94cbef5fa68dd4646dcb17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract GasTank { | |
mapping (address => uint) dappDespoit | |
function execWithRefund(invokerAddress, authSig, gasLimit, dappAddress) { | |
require(gasLimit * tx.gasPrice > dappDeposit[dappAddress]); | |
const preGas = gas.left(); | |
invokerAddress.invoke(authSig); | |
const postGas = gas.left(); | |
dappDeposit[dappAddress] -= (preGas - postGas) * tx.gasPrice; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment