Skip to content

Commit

Permalink
Merge pull request #1 from jafri/main
Browse files Browse the repository at this point in the history
.
  • Loading branch information
SuperstrongBE authored Apr 14, 2022
2 parents 51e1dbc + 5c43c17 commit 7177bf8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
target
10 changes: 5 additions & 5 deletions fivefhc.contract.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import { Asset, Contract,Contracts, Name, requireAuth, Symbol, TableStore,ExtendedSymbol, ExtendedAsset } from 'proton-tsc';
import { AtomicAttribute, AtomicValue, sendMintAsset } from "./node_modules/proton-tsc/assembly/atomicassets"
import { Asset, Name, requireAuth, Symbol, TableStore, ExtendedAsset } from 'proton-tsc';
import { sendMintAsset } from "./node_modules/proton-tsc/assembly/atomicassets"
import { AllowContract } from "./node_modules/proton-tsc/assembly/allow"
import { Items } from './items.table'

@contract
export class fivefhc extends Contracts.Allow.AllowContract {
export class fivefhc extends AllowContract {

private itemTable:TableStore<Items> = Items.GetTable(this.receiver);
private static FULL_PRICE:Asset = new Asset(10000000,new Symbol('FOOBAR',6))
Expand All @@ -13,16 +14,15 @@ export class fivefhc extends Contracts.Allow.AllowContract {

@action("mintitem")
mintitem(owner:Name, rl_multiplier:u32 ): void {

this.checkContractIsNotPaused();
requireAuth(this.receiver);
const name:Name = new Name()
const authorizedMinter = Name.fromString('fivefhc')
const exAsset = new ExtendedAsset(fivefhc.FULL_PRICE,this.receiver);
const item:Items = new Items(name,978645123,owner,owner,rl_multiplier);
this.itemTable.set(item,this.receiver);

//Contracts.Token.sendTransferTokens(owner,this.receiver,[exAsset],'');
sendMintAsset(this.contract,authorizedMinter,Name.fromString('524vigo'),Name.fromString('524vigo'),98766,owner,[],[],[]);

}
}
12 changes: 12 additions & 0 deletions playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@ async function wait(ms: number) {

const main = async () => {
const blockchain = new Blockchain();

const fivefhc = blockchain.createContract('fivefhc', 'target/fivefhc.contract',true);
const atomicAsset = blockchain.createContract('atomicassets', 'node_modules/proton-tsc/external/atomicassets/atomicassets',true);
await wait(0);

// Initialize atomicassets
await atomicAsset.actions.init().send()
await atomicAsset.actions.admincoledit([
[
{ "name": "name", "type": "string" },
{ "name": "img", "type": "ipfs" },
{ "name": "description", "type": "string" },
{ "name": "url", "type": "string" }
]
]).send()

// Put you actions calls here
await atomicAsset.actions.createcol(['fivefhc','coolcool1234',true,['fivefhc'],['fivefhc'],0.15,[]]).send('fivefhc@active')
await fivefhc.actions.mintitem(['johnson',7]).send('fivefhc@active')
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ as-bignum@^0.2.18:
resolved "https://registry.yarnpkg.com/as-bignum/-/as-bignum-0.2.18.tgz#61ed4dd07d4a62107bde227fdb4370190217bf0b"
integrity sha512-5LODrOr7wvS643oh7PHfyRtbBO9vCcU69vNNvrqh5yovrApM9nRHDeT5XcqnaSI8TqK9ZhN12qhZnq4rdIGcwQ==

[email protected].34:
version "0.0.34"
resolved "https://registry.yarnpkg.com/as-chain/-/as-chain-0.0.34.tgz#04a884a664131abdb2e9fb243aa16cf27a3ec8cc"
integrity sha512-x+60XaQtZlPRzqbVPDtlaHnUyBiIGbXXqYS183MSMNzLJPrXbp38aRODY4TDPY07Q39CUDB8GjVbqlJHPyF/Bg==
[email protected].35:
version "0.0.35"
resolved "https://registry.yarnpkg.com/as-chain/-/as-chain-0.0.35.tgz#15712571ee0ac6819f95fa4d3650f71c4089a467"
integrity sha512-QbN36q0btRAjLfUzJkYbMJMoOKZPXRAa7f5tGpAzr4weZxXxmGdCOFlqymQLyjvM598AYeKE4ejQ42a/Os7ETg==
dependencies:
"@assemblyscript/loader" "^0.19.22"
as-bignum "^0.2.18"
Expand Down Expand Up @@ -1118,22 +1118,22 @@ pify@^3.0.0:
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=

proton-asc@^0.2.78:
version "0.2.79"
resolved "https://registry.yarnpkg.com/proton-asc/-/proton-asc-0.2.79.tgz#d8a64adcce1695cf9f1d2d258cc5630b61b0b479"
integrity sha512-oR1zTxbaU2T4D5S7/Yl9yY8CHUhbZ8MbRETydDCwTIAqrHkWl/B5QwjAZNy7VLPqH4rVuIlzMMQNJn9UYIj7Yw==
proton-asc@^0.2.80:
version "0.2.82"
resolved "https://registry.yarnpkg.com/proton-asc/-/proton-asc-0.2.82.tgz#f45ac23cf6bbf34b62e4d1c8268104fce18a8a16"
integrity sha512-mGpJnVyn/COE7a9s8wja+ph+ZK6HlKP20AH8YqQJgbN+44nzsaO6tn67PQWXe/N7qdbv4JEHraJwvh/x6kUGMw==
dependencies:
as-chain "0.0.34"
as-chain "0.0.35"
assemblyscript "0.18"
handlebars "4.7.7"
ts-dedent "^2.2.0"

proton-tsc@latest:
version "0.1.2"
resolved "https://registry.yarnpkg.com/proton-tsc/-/proton-tsc-0.1.2.tgz#421776b5c62cb137f3100abcc7c6209fe78a4761"
integrity sha512-1wrjoh2zu8G9IRpIESa1u3I3G+V4xOfotW/QTXeTnqnA16GFUgMOMzwa9xIdw/AMfIumXm80beQpfTEDxVfx7Q==
proton-tsc@^0.1.4:
version "0.1.5"
resolved "https://registry.yarnpkg.com/proton-tsc/-/proton-tsc-0.1.5.tgz#565854f858dc2d4b6fd32e3f257c101340d48a08"
integrity sha512-JQieCkROzZwbxM553hxKnNMkYDLjkaYdDFXOp6uO3o69RiDIRl7HWI7A7d9N0Ui0DVgjS4ZbrM3zxKjZFIprdg==
dependencies:
proton-asc "^0.2.78"
proton-asc "^0.2.80"

randombytes@^2.1.0:
version "2.1.0"
Expand Down

0 comments on commit 7177bf8

Please sign in to comment.