mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-29 16:13: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
|
||||
}
|
||||
|
||||
// TODO
|
||||
// Predetermined create2 address of whitelist contract with exclusive mint/burn privileges.
|
||||
const whitelistCreate2Addr = "0x000000"
|
||||
|
||||
// TODO: confirm new abi schema works with contract
|
||||
func (c *mint) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
||||
|
||||
if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
||||
return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
||||
}
|
||||
// if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
||||
// return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
||||
// }
|
||||
|
||||
mintTo := common.BytesToAddress(input[0:32])
|
||||
|
||||
|
|
@ -109,12 +108,11 @@ func (c *burn) RequiredGas(input []byte) uint64 {
|
|||
return 100
|
||||
}
|
||||
|
||||
// TODO: confirm new abi schema works with contract
|
||||
func (c *burn) Run(input []byte, ctx *precompileContext) ([]byte, error) {
|
||||
|
||||
if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
||||
return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
||||
}
|
||||
// if ctx.caller != common.HexToAddress(whitelistCreate2Addr) {
|
||||
// return nil, fmt.Errorf("Error parsing transfer: caller not whitelisted")
|
||||
// }
|
||||
|
||||
burnFrom := common.BytesToAddress(input[0:32])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue