Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(async (resolve, reject) => {
const amount = (this.pramsData.dynamicInvoke === 'true' ? 500 : 0) + (this.pramsData.needsStorage === 'true' ? 400 : 0) + 90;
const fromAddress = this.neon.wallet.accounts[0].address;
let newTx = new tx.InvocationTransaction();
// tslint:disable-next-line: no-bitwise
const num = (this.pramsData.needsStorage === 'true' ? 1 : 0) | (this.pramsData.dynamicInvoke === 'true' ? 2 : 0) |
(this.pramsData.isPayable === 'true' ? 4 : 0);
const sb = new ScriptBuilder();
sb.emitPush(str2hexstring(this.pramsData.description))
.emitPush(str2hexstring(this.pramsData.email))
.emitPush(str2hexstring(this.pramsData.author))
.emitPush(str2hexstring(this.pramsData.version))
.emitPush(str2hexstring(this.pramsData.name))
.emitPush(num)
.emitPush(this.pramsData.returnType || 'ff00')
.emitPush(this.pramsData.parameterList)
.emitPush(this.pramsData.code)
.emitSysCall('Neo.Contract.Create');
try {
newTx.script = sb.str;
} catch (error) {
reject(error);
}
try {
newTx = await this.addFee(fromAddress, newTx, amount + parseFloat(this.pramsData.networkFee));
} catch (error) {
return new Promise(async (resolve, reject) => {
const amount = (this.pramsData.dynamicInvoke === 'true' ? 500 : 0) + (this.pramsData.needsStorage === 'true' ? 400 : 0) + 90;
const fromAddress = this.neon.wallet.accounts[0].address;
let newTx = new tx.InvocationTransaction();
// tslint:disable-next-line: no-bitwise
const num = (this.pramsData.needsStorage === 'true' ? 1 : 0) | (this.pramsData.dynamicInvoke === 'true' ? 2 : 0) |
(this.pramsData.isPayable === 'true' ? 4 : 0);
const sb = new ScriptBuilder();
sb.emitPush(str2hexstring(this.pramsData.description))
.emitPush(str2hexstring(this.pramsData.email))
.emitPush(str2hexstring(this.pramsData.author))
.emitPush(str2hexstring(this.pramsData.version))
.emitPush(str2hexstring(this.pramsData.name))
.emitPush(num)
.emitPush(this.pramsData.returnType || 'ff00')
.emitPush(this.pramsData.parameterList)
.emitPush(this.pramsData.code)
.emitSysCall('Neo.Contract.Create');
try {
newTx.script = sb.str;
} catch (error) {
reject(error);
}
try {
newTx = await this.addFee(fromAddress, newTx, amount + parseFloat(this.pramsData.networkFee));
} catch (error) {
this.chrome.windowCallback({
error: ERRORS.INSUFFICIENT_FUNDS,
return: requestTarget.Deploy,
return new Promise(async (resolve, reject) => {
const amount = (this.pramsData.dynamicInvoke === 'true' ? 500 : 0) + (this.pramsData.needsStorage === 'true' ? 400 : 0) + 90;
const fromAddress = this.neon.wallet.accounts[0].address;
let newTx = new tx.InvocationTransaction();
// tslint:disable-next-line: no-bitwise
const num = (this.pramsData.needsStorage === 'true' ? 1 : 0) | (this.pramsData.dynamicInvoke === 'true' ? 2 : 0) |
(this.pramsData.isPayable === 'true' ? 4 : 0);
const sb = new ScriptBuilder();
sb.emitPush(str2hexstring(this.pramsData.description))
.emitPush(str2hexstring(this.pramsData.email))
.emitPush(str2hexstring(this.pramsData.author))
.emitPush(str2hexstring(this.pramsData.version))
.emitPush(str2hexstring(this.pramsData.name))
.emitPush(num)
.emitPush(this.pramsData.returnType || 'ff00')
.emitPush(this.pramsData.parameterList)
.emitPush(this.pramsData.code)
.emitSysCall('Neo.Contract.Create');
try {
newTx.script = sb.str;
} catch (error) {
reject(error);
}
try {
newTx = await this.addFee(fromAddress, newTx, amount + parseFloat(this.pramsData.networkFee));
} catch (error) {
this.chrome.windowCallback({
return new Promise(async (resolve, reject) => {
const amount = (this.pramsData.dynamicInvoke === 'true' ? 500 : 0) + (this.pramsData.needsStorage === 'true' ? 400 : 0) + 90;
const fromAddress = this.neon.wallet.accounts[0].address;
let newTx = new tx.InvocationTransaction();
// tslint:disable-next-line: no-bitwise
const num = (this.pramsData.needsStorage === 'true' ? 1 : 0) | (this.pramsData.dynamicInvoke === 'true' ? 2 : 0) |
(this.pramsData.isPayable === 'true' ? 4 : 0);
const sb = new ScriptBuilder();
sb.emitPush(str2hexstring(this.pramsData.description))
.emitPush(str2hexstring(this.pramsData.email))
.emitPush(str2hexstring(this.pramsData.author))
.emitPush(str2hexstring(this.pramsData.version))
.emitPush(str2hexstring(this.pramsData.name))
.emitPush(num)
.emitPush(this.pramsData.returnType || 'ff00')
.emitPush(this.pramsData.parameterList)
.emitPush(this.pramsData.code)
.emitSysCall('Neo.Contract.Create');
try {
newTx.script = sb.str;
} catch (error) {
reject(error);
}
try {
newTx = await this.addFee(fromAddress, newTx, amount + parseFloat(this.pramsData.networkFee));
} catch (error) {
this.chrome.windowCallback({
error: ERRORS.INSUFFICIENT_FUNDS,
return new Promise(async (resolve, reject) => {
const amount = (this.pramsData.dynamicInvoke === 'true' ? 500 : 0) + (this.pramsData.needsStorage === 'true' ? 400 : 0) + 90;
const fromAddress = this.neon.wallet.accounts[0].address;
let newTx = new tx.InvocationTransaction();
// tslint:disable-next-line: no-bitwise
const num = (this.pramsData.needsStorage === 'true' ? 1 : 0) | (this.pramsData.dynamicInvoke === 'true' ? 2 : 0) |
(this.pramsData.isPayable === 'true' ? 4 : 0);
const sb = new ScriptBuilder();
sb.emitPush(str2hexstring(this.pramsData.description))
.emitPush(str2hexstring(this.pramsData.email))
.emitPush(str2hexstring(this.pramsData.author))
.emitPush(str2hexstring(this.pramsData.version))
.emitPush(str2hexstring(this.pramsData.name))
.emitPush(num)
.emitPush(this.pramsData.returnType || 'ff00')
.emitPush(this.pramsData.parameterList)
.emitPush(this.pramsData.code)
.emitSysCall('Neo.Contract.Create');
try {
newTx.script = sb.str;
} catch (error) {
reject(error);
}
try {
newTx = await this.addFee(fromAddress, newTx, amount + parseFloat(this.pramsData.networkFee));