Questions tagged [contract]
424 questions
3
votes
2 answers
Interface that contains a way to create an instance
I need a pattern:
I'm using C#.
Say there are three actors; Jim, Pat, and Sally. Pat's job is to create an interface as a contract between Jim and Sally. Sally's job is to create a class that implements the interface and Jim's job is to write a…

dtaylor
- 997
- 3
- 10
- 26
3
votes
3 answers
How to make the compareTo method respect the general contract?
Chromosome contains a number of scores generated in different ways.
The compareTo method actually tests the agreement of the methods and accordingly returns a result.
return 1: comp = -5..-1
return 0: comp = 0 (can happen in different scenarios…

jallmer
- 589
- 3
- 17
3
votes
2 answers
When is it fair to purposefully cause undefined behaviour?
The standard library habitually allows for undefined behaviour if you break any requirements on template types, give erroneous function arguments, or any other breach of contract. Is it considered a good practise to allow this in user libraries?…

Joseph Mansfield
- 108,238
- 20
- 242
- 324
3
votes
4 answers
Independent contracting and non-compete clauses?
I am an independent software contractor. Companies hire me to write very specific pieces of software in a particular industry. I bill/invoice companies only for the hours spent working on the specific project they have me working on.
A new client of…

Jake Wilson
- 88,616
- 93
- 252
- 370
3
votes
1 answer
Add contract to interface implementation
I understand that I cannot add preconditions on an interface implementation. I have to create a contract class where I define contracts on elements that are seen by the interface.
But in the following case, how can add a contract on an internal…

cedrou
- 2,780
- 1
- 18
- 23
3
votes
2 answers
Contract between Interface and Class in Java
What does this exactly mean in Java?
Interface defines a contract for implementing classes

mssrivatsa
- 343
- 1
- 3
- 10
2
votes
3 answers
.NET remote/work from home contract resources...that pay well
I currently work on contract/consulting on site for various local subcontracting firms. I've been making a effort to grow into my own company and one of the things I'd like to start doing is working form my own office at home.
I've located sites…

Fireworks
- 135
- 3
- 14
2
votes
2 answers
C# Code Contracts build time -- how do I improve it?
How do I figure out which proofs are the most time-consuming, to be able to help the verifier along with Asserts?
Is there any way that is better than guess-and-check?

user541686
- 205,094
- 128
- 528
- 886
2
votes
4 answers
DI in Service Contract WCF
Please find below my code. Employee class implements IEmployee interface.
namespace MiddleWare.ServiceContracts
{
[ServiceContract(Namespace = "http://mywebsite.com/MyProject")]
public interface IMiscellaneous
{
…

Rakesh Kumar Khandelwal
- 190
- 10
2
votes
1 answer
"Transaction reverted: trying to deploy a contract whose code is too large", Is 10KB too large?
I wrote a simple auction contract file and its size is 9.49KB(12KB on disk), and when I run this contract using npx hardhat test, I get this error:
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See:…

master talent
- 25
- 5
2
votes
1 answer
Issues Deploying to Polygon Mainnet
I am having issues deploying to the Polygon Mainnet. I can deploy easily to Polygon Testnet but have yet to successfully deploy to mainnet. I have tried using Truffle, Hardhat and Remix without various errors. Most errors are receiving null back in…

CryptoMike
- 21
- 2
2
votes
2 answers
Failed to call view method of NEAR contract
Deployed simple contract
#[near_bindgen]
impl Contract {
pub fn hello() -> String {
String::from("hello")
}
pub fn num() -> u8 {
8
}
}
trying to call view method by
near view crossword.hilonom.testnet num
and have…

Sergey Zhelonkin
- 21
- 1
2
votes
1 answer
Initiating a contract. Uncaught Error: You must provide the json interface of the contract when instantiating a contract object
I'm trying to initiate a contract in this way:
function initContract() {
var contractJSON = $.getJSON("contract.json", function (data) {
return data;
});
return new web3.eth.Contract(contractJSON);
}
I've also tried with
return new…

patatafly
- 144
- 10
2
votes
1 answer
Contract Address cannot receive ETH
I have tried many times but cannot transfer ETH to Contract Address.
https://rinkeby.etherscan.io/address/0xe9d0430dea9b84a9e32801d6e6072175fd48fb85
Errors such as:
Warning! Error encountered during contract execution [out of gas]
Warning! Error…

The White Tiger
- 21
- 1
2
votes
0 answers
How can i assign a new value to a function parameter in an ada postcondition
i've been trying a lot of things and looking for solutions but i can't find one.
I' m stuck because i need to assign a new value to a post condition in an ada function
For example, with the following function:
function Square(A: in out INTEGER)…

Alexis Guillot
- 21
- 1