Skip to content

Commit

Permalink
restrict transfer from
Browse files Browse the repository at this point in the history
  • Loading branch information
laizy committed Jun 3, 2024
1 parent a42a36e commit 6e1aa58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion smartcontract/service/native/ont/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ func TransferedFrom(native *native.NativeService, currentContract common.Address
return
}
} else {
if state.Sender != state.To && !native.ContextRef.CheckWitness(state.Sender) {
// after OntHolderUnboundDeadline, ong will be transfered automaticly when user's ont balance changed.
allowOntTransferOng := native.ContextRef.CheckWitness(utils.OntContractAddress) && state.Sender == state.To &&
state.From == utils.OntContractAddress
if !allowOntTransferOng && !native.ContextRef.CheckWitness(state.Sender) {
err = errors.NewErr("authentication failed!")
return
}
Expand Down

0 comments on commit 6e1aa58

Please sign in to comment.