Questions tagged [contract]

424 questions
0
votes
1 answer

I don't understand why the holder balance is still 0 after he gets tokens

I've been playing with this contract on Ropsten: https://pastebin.com/XPVxPNFv function distribution(address[] addresses, uint256 _amount) onlyOwner public { uint256 _remainingAmount = _MaxDistribPublicSupply -…
John
  • 3
  • 3
0
votes
2 answers

Core data: Managing employee contracts in a many-to-many relationship?

I am mapping an idea for a relationship using Core Data. I have an Employer entity who has a many-to-many relationship with Employees. Basically, an employee can work for multiple employers, and an employer can have multiple employees. The problem…
zardon
  • 2,910
  • 6
  • 37
  • 58
0
votes
0 answers

Poscondition for ArrayList add method

How would you guys write a postcondition for this method? public void push(ArrayList n) { numbers.add(n); } I tried: @Ensures("result == true && this.equals(old(new ArrayList((numbers.add(n)))))") (result == true) => because add() returns…
ismael oliva
  • 97
  • 1
  • 3
  • 11
0
votes
1 answer

Expecting PreconditionError but got NullPointerException

I have a class Natural with a precondition before the constructor method (notice the requires). public class Natural { private int data; @Requires("n != null") public Natural(Natural n) { this(n.data); } } This is the test for that…
ismael oliva
  • 97
  • 1
  • 3
  • 11
0
votes
1 answer

remix account get private key

I want to sign message in remix, interacting with ethereum contract. But I can't find private key.
silva
  • 405
  • 4
  • 8
0
votes
1 answer

How does Etherenum get my deployed contract info?

I am practice to Truffle to build my contracts. When I finished my contract, open testrpc. And use this command line as blow to deploy my contract. truffle migrate Etherenum can get my deployed contract info if I write some code in my app.js as…
0
votes
2 answers

Can't withdraw amount from contract on Ethereum local blockchain

I am having an issue that is blocking me for days. And it all comes down to this: I am using Ganache (TestRPC) for my local blockchain with it's default test accounts. I am connected with Metamask(on Chrome) using the first test account. (balance…
Razor
  • 719
  • 8
  • 18
0
votes
2 answers

Store contract results tag in a variable

I have a web3 contstant look like this. const test = contract_instance.methods.getPost(15).call().then(console.log); This returns results like this. Result { '0': '2017-08-28', '1': '19:18:04.986593', '2': '07:17:00', '3': '11112323', …
user7421798
  • 103
  • 11
0
votes
2 answers

Contract Checking in Java - In Built? E.g. Hashcode/Equals

Is there any in-built contract checking in Java e.g. for the contract between a hashcode and the equals function? For this question, let's stick with the hashcode/equals contract as an example, but I'm interested in contract checking in general. I…
Colm Bhandal
  • 3,343
  • 2
  • 18
  • 29
0
votes
1 answer

Must the Flow code be the same in all nodes?

As the Contract code, must the Flow code be the same on all nodes? Supposing it's allowed to have different code, how does Corda handle that, in the sense of compatibility, versioning, etc?
Maka
  • 357
  • 1
  • 11
0
votes
1 answer

blogchain deploy contract on testnet

I am running truffle migrate to deploying a contract and upload it to the testnet. but the result of deploying it is not understood. here is the output after running the contract: Using network 'live'. Running migration:…
0
votes
1 answer

Ethereum contract code visualization

I am using Ethereum with testnet Rinkeby, I created a contract and deployed it. Is there a way to display the source code of that contract? I know that contact are immutable but I want just to have a look on the code.
HJDEV
  • 80
  • 8
0
votes
1 answer

Odoo 8 - create automatically open invoice

We're working on Odoo 8, enjoying this app. We'd like to create open invoice automatically for every customer. We create contracts and it works well, but we still have to click on "generate invoice" and it creates draft invoice. To those two issues,…
0
votes
2 answers

What's the purpose of convoluted racket contract?

I am walking through the racket guide and just finished this page: https://docs.racket-lang.org/guide/contracts-first.html And the resulting contract is so convoluted that I couldn't believe my eyes: (provide (contract-out [argmax (->i ([f…
Jason Hu
  • 6,239
  • 1
  • 20
  • 41
0
votes
1 answer

recursive contract like Typed Racket's 'Rec' type

Typed Racket's Rec type is an easy way to make recursive types: #lang typed/racket/base (define (deep (n : Integer)) : (Rec T (U Integer (List T))) (if (zero? n) n (list (deep (- n 1))))) Is there a similar way to make a recursive…
Ben Greenman
  • 1,945
  • 12
  • 22