Transaction

765b1fabf9b00e449f30f34111bc91f8b69aac801e5b928c53057d3e77b852b2
( - )
224,310
2020-10-08 00:24:12
1
15,306 B

6 Outputs

Total Output:
  • jrun b1b605103eM¨8{"in":0,"ref":["native://Jig"],"out":["7ba55c6780ba4ec74811287bddeb7318d0346716cf9d534c57c5d4e3acffcee8","1a41ef4993716e96fafd6d19883ce7fc396c2a92d76d7182d297d9ac7243144a"],"del":[],"cre":["mq6L3kcLJv6RJrYZarqrYv6FpM8zfmhDFU","mq6L3kcLJv6RJrYZarqrYv6FpM8zfmhDFU"],"exec":[{"op":"DEPLOY","data":["class Wc extends Jig {init(e,...t){this.classname=\"TokenContract: \";const r=this.classname+\"init(): \";if(Object.getPrototypeOf(this.constructor)===Jig)throw new Error(r+\"must be extended\");if(this._checkTimestamp(e),null!=caller){if(caller===this.constructor){if(caller.mintAmount){const t=r+\" mint : \";try{if(this.constructor.isRevoked())throw new Error(t+\"token contract has been revoked\");if(this.constructor.isBackedup())throw new Error(t+\"token contract has been backedup\");if(this.constructor.isFrozen())throw new Error(t+\"token contract has been frozen\");this._checkAmount(caller.mintAmount),this.amount=caller.mintAmount,this.action=\"mint\",this.timestamp=e,this.oldest_mint_count=this.constructor.nonce}catch(e){throw new Error(t,e)}return}{const n=r+\" convert : \";try{if(!t)throw new Error(n+\" tokens array from parameters not found \");if(1!=t.length)throw new Error(n+\" tokens array from parameters has length \"+t.length+\", length should be 1\");if(this.constructor.isRevoked())throw new Error(n+\"token contract has been revoked\");if(this.constructor.isBackedup())throw new Error(n+\"token contract has been backedup\");if(this.constructor.isFrozen())throw new Error(n+\"token contract has been frozen\");if(!this.constructor.accepted_conversions)throw new Error(n+\"no accepted_conversions found in the token contract\");if(0==this._checkNotBlacklisted(this.owner))throw new Error(n+\"your address got blacklisted : \"+this.owner);if(r.constructor.isRevoked()){const e=r.constructor.revokercontract;if(!e)throw new Error(n+\" no contract.revokercontract found in the contract of the token to convert\");const t=e.revoke_count;if(r.oldest_mint_count>=t)throw new Error(n+\"cannot convert revoked tokens\")}if(!e)throw n+\"timestamp missing: \"+e;this._checkTimestamp(e);const r=t[0];if(e<=r.timestamp)throw new Error(n+\"you cannot convert with a timestamp that is before the old_token's timestamp: \"+e+\" <= \"+r.timestamp);if(!r)throw new Error(n+\"you must give an old token to convert for a new one, old_token=\"+r);if(!(r instanceof Jig))throw new Error(n+\"bad old_token type, should be a Jig\");if(!this.constructor.accepted_conversions.includes(r.constructor.origin))throw new Error(n+\" wrong old_token origin: current token_contract.accepted_conversions doesn't include \"+r.constructor.origin);if(this.owner!=r.owner)throw new Error(n+\"you cannot convert an old_token that you do not own\");r.destroy(),this.action=\"convert\",this.amount=r.amount,this.timestamp=e,this.oldest_mint_count=0}catch(e){throw new Error(n,e)}return}}if(caller&&caller.constructor===this.constructor){const t=r+\" send : \";try{if(this.constructor.isRevoked())throw new Error(t+\"token contract has been revoked\");if(this.constructor.isBackedup())throw new Error(t+\"token contract has been backedup\");if(this.constructor.isFrozen())throw new Error(t+\"token contract has been frozen\");if(this.isBlacklisted(caller.sendSender))throw new Error(t+\"your address got blacklisted: \"+caller.sendSender);if(this.isBlacklisted(caller.sendOwner))throw new Error(t+\"the address you are trying to send to got blacklisted: \"+caller.sendOwner);this._checkAmount(caller.sendAmount),this.amount=caller.sendAmount,this.owner=caller.sendOwner,this.timestamp=e,this.sender=caller.sendSender,this.oldest_mint_count=caller.send_oldest_mint_count,this.action=\"send\"}catch(e){throw new Error(t,e)}}else;}else{const i=r+\" combine : \";try{if(this.constructor.isRevoked())throw new Error(r+\"token contract has been revoked\");if(this.constructor.isBackedup())throw new Error(r+\"token contract has been backedup\");if(this.constructor.isFrozen())throw new Error(r+\"token contract has been frozen\");if(!Array.isArray(t)||t.length<2)throw new Error(i+\"Invalid tokens to combine : \",t);if(t.some(e=>e.constructor!==this.constructor))throw new Error(i+\"Cannot combine different token classes\");const a=e=>t.reduce((t,r)=>r===e?t+1:t,0);if(t.some(e=>a(e)>1))throw new Error(i+\"Cannot combine duplicate tokens\");this.amount=0;var n=null;t.forEach(e=>{if(this.isBlacklisted(e.owner))throw new Error(i+\"your address got blacklisted: \"+e.owner);this.amount+=e.amount,(null==n||e.oldest_mint_count<n)&&(n=e.oldest_mint_count),e.destroy()}),this.action=\"combine\",this.timestamp=e,this.oldest_mint_count=n,this._checkAmount(this.amount)}catch(e){throw new Error(i,e)}}}static allow_convert_from_previous_contract(e){const t=this.name+(this.tokenName?\" (\"+this.tokenName+\")\":\"\")+\": allow_convert_from_previous_contract(): \";if(this.accepted_conversions)throw new Error(t+\"already called this function, it can only be called once.\");if(this.accepted_conversions=[],!(e instanceof Jig))throw new Error(t+\" parameter previous_tokencontract must be a Jig\");if(e.origin=this.origin)throw new Error(t+\"cannot link a contract to itself\");if(!e.revokercontract)throw new Error(t+\" previous_tokencontract.revokercontract not found\");if(!e.multlist)throw new Error(t+\" previous_tokencontract.multlist not found\");if(!e.blacklist)throw new Error(t+\" previous_tokencontract.blacklist not found\");if(!e.mint_action_numbers)throw new Error(t+\" previous_tokencontract.mint_action_numbers not found\");if(!e.mint_list)throw new Error(t+\" previous_tokencontract.mint_list not found\");var r=null,n=0,i=0;if(e.revokercontract.is_revoked){if(!(r=e.revokercontract.revoke_count))throw new Error(t+\" contract was revoked but revoke_count not found in \"+e.revokercontract.location);for(mint_actionnums=e.mint_action_numbers,mintlist=e.mint_list,i=0;mint_actionnums[i]<r;)n+=mintlist[i],i+=1}else n=e.supply;this.supply+=n,this.accepted_conversions.push([e.origin,r]);const a=e.accepted_conversions;for(i=0;i<a.length;i++)this.accepted_conversions.push(a[i]);var o=e.multlist,s=e.blacklist;for(i=0;o.list_action_numbers[i]<r;){var c=o.list[i],l=o.timestamps[i];this.multlist.publish(c,l),i+=1}for(i=0;s.list_action_numbers[i]<r;){var u=s.list[i];l=s.timestamps[i];this.blacklist.blacklist(u,l),i+=1}}static mint(e,t){this.name,this.tokenName&&this.tokenName;this.mintAmount=e,this.mint_list||(this.mint_list=[]),this.mint_timestamps||(this.mint_timestamps=[]),this.mint_action_numbers||(this.mint_action_numbers=[]),this.mint_list.push(e),this.mint_timestamps.push(t),this.mint_action_numbers.push(this.nonce);const r=new this(t);return delete this.mintAmount,this.supply+=e,r}static combine(e,...t){this.name,this.tokenName&&this.tokenName;return new this(e,...t)}static convert_tokens(e,...t){const r=this.name+(this.tokenName?\" (\"+this.tokenName+\")\":\"\")+\": convert_tokens(): \";var n=[];try{t.forEach(t=>{var r=new this(e,t);n.push(r)})}catch(e){throw new Error(r,e)}return n}static reduceSupplyIfAdmin(e){const t=this.name+(this.tokenName?\" (\"+this.tokenName+\")\":\"\")+\": reduceSupplyIfAdmin(): \";if(!(caller instanceof this))throw t+\" this function cannot be called by a user (it is static but also private in a way)\";if(\"number\"!=typeof e)throw new Error(t+\"amount is not a number : \"+e);if(!Number.isInteger(e))throw new Error(t+\"amount must be an integer : \"+e);if(e<=0)throw new Error(t+\"amount must be positive : \"+e);if(e>Number.MAX_SAFE_INTEGER)throw new Error(t+\"amount too large : \"+e);if(e>this.supply)throw t+\" amount too large, you are trying to reduce supply by \"+e+\" but supply is \"+this.supply;this.supply-=e}destroy(){this.classname;null==caller&&this.owner==this.constructor.owner&&this.constructor.reduceSupplyIfAdmin(this.amount),super.destroy(),this.action=\"destroy\",this.amount=0}burn(e,t){const r=this.classname+\"burn(): \";if(this.constructor.isRevoked())throw new Error(r+\"token contract has been revoked\");if(this.constructor.isBackedup())throw new Error(r+\"token contract has been backedup\");if(this.constructor.isFrozen())throw new Error(r+\"token contract has been frozen\");if(this.owner!=this.constructor.owner)throw r+\" Only \"+this.classname+\" class owner can burn\\n class owner is \"+this.constructor.owner+\" and you are \"+this.owner;if(t=void 0===t?this.amount:t,this._checkAmount(t),t>this.amount)throw r+\" not enough funds. Trying to burn \"+t+\" & this.amount=\"+this.amount;if(!e)throw r+\" timestamp missing: \"+e;this._checkTimestamp(e),this.timestamp=e,this.action=\"burn\",this.amount_burnt=t,this.action_count=this.constructor.nonce,t==this.amount?this.amount=0:this.amount-=t,this.constructor.reduceSupplyIfAdmin(t)}send(e,t,r=this.amount){const n=this.classname+\"send(): \";try{if(this.constructor.isRevoked())throw new Error(n+\"token contract has been revoked\");if(this.constructor.isBackedup())throw new Error(n+\"token contract has been backedup\");if(this.constructor.isFrozen())throw new Error(n+\"token contract has been frozen\");if(this._checkAmount(r),r>this.amount)throw new Error(n+\"Not enough funds\");if(this._checkTimestamp(t),t<=this.timestamp)throw n+\"you cannot send with a timestamp that is before the coin to send's timestamp: \"+t+\" <= \"+this.timestamp;if(this.isBlacklisted(this.owner))throw n+\"your address got blacklisted: \"+this.owner;if(this.isBlacklisted(e))throw n+\" the address you are trying to send to got blacklisted: \"+e;this.sendAmount=r,this.sendOwner=e,this.sendSender=this.owner,this.send_oldest_mint_count=this.oldest_mint_count;const i=new this.constructor(t);return delete this.sendAmount,delete this.sendOwner,delete this.sendSender,delete this.send_oldest_mint_count,this.amount===r?this.destroy():(this.amount-=r,this.action=\"change\"),i}catch(e){throw n+e}}isBlacklisted(e){var t=this.constructor.blacklist;if(!t)throw function_id+\" no blacklist found\";return t.isBlacklisted(e)}_checkNotBlacklisted(e){const t=this.classname+\"_checkNotBlacklisted(): \";var r=this.constructor.blacklist;if(!r)throw new Error(t+\" no blacklist found\");if(r.list.includes(e))throw new Error(t+\"address got blacklisted: \"+e);return!0}static isFrozen(){const e=this.classname+\"isFrozen(): \";if(!this.revokercontract)throw new Error(e+\"no revokercontract found\");return this.revokercontract.is_frozen}static isBackedup(){const e=this.classname+\"isBackedup(): \";if(!this.revokercontract)throw new Error(e+\"no revokercontract found\");return this.revokercontract.is_backedup}static isRevoked(){const e=this.classname+\"isRevoked(): \";if(!this.revokercontract)throw new Error(e+\"no revokercontract found\");return this.revokercontract.is_revoked}_checkRevokeState(){const e=this.classname+\"_checkRevokeState(): \";var t=this.constructor.revokercontract;if(!t)throw new Error(e+\" no revokercontract found\");if(t.is_backedup)throw new Error(e+\" token contract has been backedup\");if(t.is_revoked)throw new Error(e+\" token contract has been revoked\");if(t.is_frozen)throw new Error(e+\" token contract has been frozen\");return!0}_checkAmount(e){const t=this.classname+\": _checkAmount(): \";if(\"number\"!=typeof e)throw new Error(t+\"amount is not a number : \"+e);if(!Number.isInteger(e))throw new Error(t+\"amount must be an integer : \"+e);if(e<=0)throw new Error(t+\"amount must be positive : \"+e);if(e>Number.MAX_SAFE_INTEGER)throw new Error(t+\"amount too large : \"+e)}_checkNum(e){const t=this.classname+\": _checkNum(): \";if(\"number\"!=typeof e)throw t+\"number is not a number : \"+e;if(!(e>0))throw new Error(t+\"number must be positive : \"+e);if(e>Number.MAX_SAFE_INTEGER)throw new Error(t+\"number too large : \"+e)}_checkTimestamp(e){const t=this.classname+\": _checkTimestamp(): \";try{this._checkAmount(e)}catch(e){throw t+e}if(!(e>1600939295117))throw t+\": timestamp must be older than 1600939295117 : \"+e}}",{"decimals":8,"deps":{"Jig":{"$jig":0},"expect":{"$jig":2}},"icon":{"emoji":null},"sealed":false,"supply":0,"symbol":null},"function expect(t){let e=!1;const n=t=>{if(\"object\"!=typeof t||!t)return t;try{return JSON.stringify(t)}catch(e){return t.toString()}};function r(r,o,i){if(e?r:!r)throw new Error(i||`expected value${e?\" not\":\"\"} to be ${o} but was ${n(t)}`)}function o(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(\"object\"!=typeof t)return!1;if(null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;if(!Object.keys(t).every(n=>o(t[n],e[n])))return!1;if(t instanceof Set){if(t.size!==e.size)return!1;if(!o(Array.from(t.entries()),Array.from(e.entries())))return!1}if(t instanceof Map){if(t.size!==e.size)return!1;if(!o(Array.from(t.entries()),Array.from(e.entries())))return!1}return!0}function i(t,e){if(\"function\"!=typeof t)return!1;if(\"function\"!=typeof e)return!1;for(;t;)if((t=Object.getPrototypeOf(t))===e)return!0;return!1}return{get not(){return e=!e,this},toBe:(e,o)=>r(t===e,\"\"+n(e),o),toEqual:(e,i)=>r(o(t,e),\"equal to \"+n(e),i),toBeInstanceOf:(e,n)=>r(t&&t instanceof e,\"an instance of \"+(e&&e.name),n),toBeDefined:e=>r(void 0!==t,\"defined\",e),toBeNull:e=>r(null===t,\"null\",e),toBeNumber:e=>r(\"number\"==typeof t,\"a number\",e),toBeInteger:e=>r(Number.isInteger(t),\"an integer\",e),toBeLessThan:(e,n)=>r(t<e&&\"number\"==typeof t&&\"number\"==typeof e,\"less than \"+e,n),toBeLessThanOrEqualTo:(e,n)=>r(t<=e&&\"number\"==typeof t&&\"number\"==typeof e,\"less than or equal to \"+e,n),toBeGreaterThan:(e,n)=>r(t>e&&\"number\"==typeof t&&\"number\"==typeof e,\"greater than \"+e,n),toBeGreaterThanOrEqualTo:(e,n)=>r(t>=e&&\"number\"==typeof t&&\"number\"==typeof e,\"greater than or equal to \"+e,n),toBeBoolean:e=>r(\"boolean\"==typeof t,\"a boolean\",e),toBeString:e=>r(\"string\"==typeof t,\"a string\",e),toBeObject:e=>r(t&&\"object\"==typeof t,\"an object\",e),toBeArray:e=>r(Array.isArray(t),\"an array\",e),toBeSet:e=>r(t instanceof Set,\"a set\",e),toBeMap:e=>r(t instanceof Map,\"a map\",e),toBeUint8Array:e=>r(t instanceof Uint8Array,\"a uint8array\",e),toBeClass:e=>r(\"function\"==typeof t&&t.toString().startsWith(\"class\"),\"a class\",e),toBeFunction:e=>r(\"function\"==typeof t&&!t.toString().startsWith(\"class\"),\"a function\",e),toBeJigClass:e=>r(\"function\"==typeof t&&t.toString().startsWith(\"class\")&&i(t,Jig),\"a jig class\",e),toExtendFrom:(e,n)=>r(i(t,e),\"an extension of \"+(e&&e.name),n)}}",{"deps":{"Jig":{"$dup":["1","deps","Jig"]}}}]}]}
    https://whatsonchain.com/tx/765b1fabf9b00e449f30f34111bc91f8b69aac801e5b928c53057d3e77b852b2
Total Output: