feat(core): implement core MEV bot functionality with market scanning and Uniswap V3 pricing
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
45
vendor/github.com/crate-crypto/go-ipa/bandersnatch/fp/fp.go
generated
vendored
Normal file
45
vendor/github.com/crate-crypto/go-ipa/bandersnatch/fp/fp.go
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
package fp
|
||||
|
||||
import (
|
||||
basefield "github.com/consensys/gnark-crypto/ecc/bls12-381/fr"
|
||||
)
|
||||
|
||||
// Element is a field element representing the basefield of the curve.
|
||||
type Element = basefield.Element
|
||||
|
||||
// Limbs is the number of 64-bit words needed to represent the field element.
|
||||
const Limbs = basefield.Limbs
|
||||
|
||||
// One returns the field element 1.
|
||||
func One() Element {
|
||||
return basefield.One()
|
||||
}
|
||||
|
||||
// Zero returns the field element 0.
|
||||
func Zero() Element {
|
||||
return basefield.Element{}
|
||||
}
|
||||
|
||||
// MinusOne returns the field element -1.
|
||||
func MinusOne() Element {
|
||||
m_one := One()
|
||||
m_one.Neg(&m_one)
|
||||
return m_one
|
||||
}
|
||||
|
||||
// MulBy5 multiplies a field element by 5.
|
||||
func MulBy5(a *Element) {
|
||||
basefield.MulBy5(a)
|
||||
}
|
||||
|
||||
// BatchInvert computes the inverse of a slice of field elements.
|
||||
func BatchInvert(a []Element) []Element {
|
||||
return basefield.BatchInvert(a)
|
||||
}
|
||||
|
||||
// BytesLE returns the little-endian byte representation of a field element.
|
||||
func BytesLE(a Element) []byte {
|
||||
var result [basefield.Bytes]byte
|
||||
basefield.LittleEndian.PutElement(&result, a)
|
||||
return result[:]
|
||||
}
|
||||
Reference in New Issue
Block a user