Skip to content

Commit

Permalink
Changed method selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
BlobMaster41 committed Jan 10, 2025
1 parent 8a13e64 commit 9a1f7e0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@btc-vision/btc-runtime",
"version": "1.3.21",
"version": "1.4.0",
"description": "Bitcoin Smart Contract Runtime",
"main": "btc/index.ts",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions runtime/contracts/DeployableOP_20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,19 @@ export abstract class DeployableOP_20 extends OP_NET implements IOP_20 {
response = new BytesWriter(U256_BYTE_LENGTH);
response.writeU256(this.maxSupply);
break;
case encodeSelector('allowance'):
case encodeSelector('allowance(address,address)'):
return this.allowance(calldata);
case encodeSelector('approve'):
case encodeSelector('approve(address,uint256)'):
return this.approve(calldata);
case encodeSelector('approveFrom'):
case encodeSelector('approveFrom(address,address,uint256,bytes)'):
return this.approveFrom(calldata);
case encodeSelector('balanceOf'):
case encodeSelector('balanceOf(address)'):
return this.balanceOf(calldata);
case encodeSelector('burn'):
case encodeSelector('burn(uint256)'):
return this.burn(calldata);
case encodeSelector('transfer'):
case encodeSelector('transfer(address,uint256)'):
return this.transfer(calldata);
case encodeSelector('transferFrom'):
case encodeSelector('transferFrom(address,address,uint256)'):
return this.transferFrom(calldata);
default:
return super.execute(method, calldata);
Expand Down
8 changes: 5 additions & 3 deletions runtime/contracts/OP_NET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { encodeSelector, Selector } from '../math/abi';
import { Calldata } from '../types';
import { Address } from '../types/Address';
import { Revert } from '../types/Revert';
import { ADDRESS_BYTE_LENGTH } from '../utils/lengths';
import { ADDRESS_BYTE_LENGTH } from '../utils';

export class OP_NET implements IBTC {
public get address(): Address {
Expand All @@ -17,9 +17,11 @@ export class OP_NET implements IBTC {
return Blockchain.contractDeployer;
}

public onDeployment(_calldata: Calldata): void {}
public onDeployment(_calldata: Calldata): void {
}

public onExecutionCompleted(): void {}
public onExecutionCompleted(): void {
}

public execute(method: Selector, _calldata: Calldata): BytesWriter {
let response: BytesWriter;
Expand Down

0 comments on commit 9a1f7e0

Please sign in to comment.