Skip to content

Commit

Permalink
Allow calls from deployed contracts only
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Aug 4, 2021
1 parent 6d71701 commit 2fca9c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/neo/SmartContract/Native/GasToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ internal override async ContractTask OnPersist(ApplicationEngine engine)
private async ContractTask Refuel(ApplicationEngine engine, UInt160 account, long amount)
{
if (amount <= 0) throw new ArgumentOutOfRangeException(nameof(amount));
if (ContractManagement.GetContract(engine.Snapshot, engine.CallingScriptHash) is null)
throw new InvalidOperationException();
if (!engine.CheckWitnessInternal(account)) throw new InvalidOperationException();
engine.Refuel(amount);
await Burn(engine, account, amount);
Expand Down

0 comments on commit 2fca9c3

Please sign in to comment.