mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-12 06:53:46 +00:00
rm canTransfer check along with nits
This commit is contained in:
parent
205a1b31d6
commit
3e2ff2b186
3 changed files with 6 additions and 6 deletions
|
|
@ -112,6 +112,9 @@ func (c *burn) RequiredGas(input []byte) uint64 {
|
||||||
return 100
|
return 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note ctx.CanTransfer method obtains an incorrect balance w.r.t "burnFrom" address,
|
||||||
|
// specifically during estimateGas. The CanTransfer check was therefore removed,
|
||||||
|
// and the calling contract is responsible for checking balance.
|
||||||
func (c *burn) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
func (c *burn) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
||||||
|
|
||||||
if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
||||||
|
|
@ -128,11 +131,6 @@ func (c *burn) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
||||||
return nil, fmt.Errorf("Error parsing transfer: unable to parse value from " + hexutil.Encode(input[32:64]))
|
return nil, fmt.Errorf("Error parsing transfer: unable to parse value from " + hexutil.Encode(input[32:64]))
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ctx.CanTransfer(ctx.evm.StateDB, burnFrom, value) {
|
|
||||||
log.Error("Error parsing transfer, address: " + burnFrom.Hex() + " has insufficient balance. " +
|
|
||||||
value.String() + " needed " + ctx.evm.StateDB.GetBalance(burnFrom).String() + " available")
|
|
||||||
return nil, ErrInsufficientBalance
|
|
||||||
}
|
|
||||||
ctx.evm.StateDB.SubBalance(burnFrom, value)
|
ctx.evm.StateDB.SubBalance(burnFrom, value)
|
||||||
|
|
||||||
return input, nil
|
return input, nil
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,4 @@ mevcommitsettlement:
|
||||||
# Partial override sepolia config for custom rpc
|
# Partial override sepolia config for custom rpc
|
||||||
sepolia:
|
sepolia:
|
||||||
rpcUrls:
|
rpcUrls:
|
||||||
- http: https://1rpc.io/sepolia
|
- http: https://eth-sepolia.g.alchemy.com/v2/a0wg_g1X-Wz4IeVA-0SS3PsQhbyQNjc_
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
set -x
|
set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# TODO: Stress test bridge back to sepolia, including not having enough balance on sidechain.
|
||||||
|
|
||||||
read -p "Has the whitelist contract been deployed, updated with hypERC20 addr, and have router addresss been pasted into this file? (y/n): " answer
|
read -p "Has the whitelist contract been deployed, updated with hypERC20 addr, and have router addresss been pasted into this file? (y/n): " answer
|
||||||
if [ "$answer" = "y" ]; then
|
if [ "$answer" = "y" ]; then
|
||||||
echo "Continuing with bridging process..."
|
echo "Continuing with bridging process..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue