mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-13 15:33:47 +00:00
Update contracts_with_ctx.go
This commit is contained in:
parent
782bb41681
commit
a73391dc42
1 changed files with 7 additions and 9 deletions
|
|
@ -77,15 +77,14 @@ func (c *mint) RequiredGas(input []byte) uint64 {
|
||||||
return 100
|
return 100
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// Predetermined create2 address of whitelist contract with exclusive mint/burn privileges.
|
||||||
const whitelistCreate2Addr = "0x000000"
|
const whitelistCreate2Addr = "0x000000"
|
||||||
|
|
||||||
// TODO: confirm new abi schema works with contract
|
|
||||||
func (c *mint) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
func (c *mint) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
||||||
|
|
||||||
if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
// if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
||||||
return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
// return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
||||||
}
|
// }
|
||||||
|
|
||||||
mintTo := common.BytesToAddress(input[0:32])
|
mintTo := common.BytesToAddress(input[0:32])
|
||||||
|
|
||||||
|
|
@ -109,12 +108,11 @@ func (c *burn) RequiredGas(input []byte) uint64 {
|
||||||
return 100
|
return 100
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: confirm new abi schema works with contract
|
|
||||||
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) {
|
||||||
return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
// return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
||||||
}
|
// }
|
||||||
|
|
||||||
burnFrom := common.BytesToAddress(input[0:32])
|
burnFrom := common.BytesToAddress(input[0:32])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue