Questions tagged [contract]
424 questions
1
vote
1 answer
Where to get the .buildTransaction() dictionary web3 eth
When you try to use the functions of a specific contract in web3 you should add the .buildTransaction() to add the dictionary of parameters of the function. for example on the documentation of web3 one should call the function and after that the…

Angel2207
- 11
- 1
- 2
1
vote
1 answer
Does the example below violate Liskov Substitution Principal?
Could anybody tell me the example below violate LSP or not?
I have an example:
public class Person {
private String name;
private Integer age;
public Person(String name, Integer age) {
this.name = name;
this.age = age;
…

DXT
- 23
- 5
1
vote
1 answer
Expanding DIV on mouseover / un-expands on mouseout
I found this Q/A,
But when I modify it for my usage as seen here http://jsfiddle.net/6PDEA/4/ the bottom-most div doesn't stay closed. Can anyone help?
EDIT: 1st answer fixed the "expanded on load" issue, but not the bottom-most DIV
EDIT 2: Final…

Shawn
- 11
- 1
- 3
1
vote
1 answer
I want to connect contract without using meta mask
want to show contract information for some people but don't want to use meta mask-before used meta mask and web3 and it work-now want when customer check our site(html/java scrips Front end for contract) they never install meta mask and just…

owl
- 21
- 1
- 8
1
vote
1 answer
solidity, how to send tuple array data to contract
my code :
{
"constant": false,
"inputs": [
{
"name": "_id",
"type": "uint256"
},
{
"components": [
{
"name": "trait_type",
…

i'm dj koo
- 11
- 4
1
vote
1 answer
Explicit Type Conversion in Remix
This function:
function initializeDomainSeparator() public {
// hash the name context with the contract address
EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(// solium-disable-line
EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,
…

TNJCoding
- 45
- 1
- 9
1
vote
1 answer
Error: Returned error: VM Exception while processing transaction: revert Not Enough Balance -- Reason given: Not Enough Balance
Here is the transfer function of my erc20 token which called "CBC"
function transfer(address receiver, uint numTokens) public payable returns (bool) {
require(numTokens <= balances[msg.sender],"Not Enough Balance");
…

Yifan Lim
- 23
- 5
1
vote
1 answer
How Would I Write A Function Requiring Sender to Hold an ERC20 to Use Function
Does anyone know how to create a function that requires sender to have at least one token to use the function? For example, to require sender's balance to have an ether, I'd use:
require(balances[msg.sender] >= 1 ether);
How would I instead create…

Brian Lee Victory
- 63
- 4
1
vote
2 answers
Truffle doesn't recognize contract change and wont deploy it
I have a bit weird situation..I was able to deploy my contract to local Ganache instance with:
truffle migrate --network develop
However, now when I make any change to the contract and run the same command, my contract gets compiled but at the end…

Zed
- 5,683
- 11
- 49
- 81
1
vote
1 answer
Getting array of struct from another contract
I have 2 contracts.
contract Contract1{
struct Data {
uint data1;
string data2;
}
Data [] newData;
}
Let's assume that I have datas in newData
import "./Contract1.sol";
contract Contract2{
Data storage newOne = newData[0];
}
I…

almi
- 65
- 5
1
vote
1 answer
Pact post deploy contract verification
I am using Pact JS for contract testing. I have written both the provider and consumer part and uploaded them to the pact broker. Contracts URLs are pointing to my QA environment. I want to create a Slack webhook that would run on a daily basis and…

keith meow
- 11
- 1
1
vote
0 answers
What arguments to pass method to get different properties of an object depending on caller? Method signature and implementation
Some architecture introduction before I formulate the problem
I have many WCF services; ServiceLargeObject, ServiceA, ServiceB, ServiceC, ..., ServiceZ.
I have a WCF contract describing a large object that each service has access to in the form of a…

Wilton Hotz
- 11
- 3
1
vote
0 answers
contract validate error : The originEnergyLimit must be > 0 . Tron ide error
I have trying to deploy contract at tron mainnet by tronide. but getting below error.
contract validate error : The originEnergyLimit must be > 0
TronIde Current Setting
FeeLimit = 400000000,
User Fee Percentage = 100
OriginEnergyLimit =…

Eithan pitt
- 841
- 9
- 12
1
vote
3 answers
Design by Contract library (interface) thoughts?
I am looking at design by contract for a Java library, this what I came up with so far in terms of the interface.
The user could call executeContract and executeContract invokes invokeContract after calling 'require'. ensure is called after…

Berlin Brown
- 11,504
- 37
- 135
- 203
1
vote
0 answers
I want my smart contract to work with USDT
Im implementing a smart contract but i want every payable transaction work with USDT. My contract is working fine but its working with TRX.
Im using tronweb to interact with it from FrontEnd.
I tried using tokenid: on send parameter, but i found…

Bryan Ordoñez
- 11
- 1