This is a draft of a new upcoming feature. We'd like to get community feedback on it before implementing.

Contract system in Screeps works in a similar way like smart contracts in cryptocurrency world. Using contracts you can automatically provide services to other players in a controllable and transparent manner.

A contract works like an external read-only script module which is executed on your behalf. It uses your CPU, your creeps and structures, but you cannot neither modify this code nor stop its execution during the contract term.

Some contract examples:

Find any suitable creep and send it to a room specified by another player to harvest a source/mineral and drop all resources in the specified position for him.

Use a courier creep to haul resources from room X to room Y.

Send X amount of the specified resource to another player's room every Y ticks.

Park a creep in the specified room and run some "find-attack" logic when neccessary.

Send a party to build up your remote colony.

...and many more. You can negotiate any code that your contractor agrees to execute. It looks like a regular script module:

const sourceId = 'XXX'; const dropPosition = new RoomPosition(15, 20, 'W1N1'); module.exports.loop = function() { var creep = _.find(Game.creeps, i => i.memory.role == 'contractorHarvester'); if(!creep) { return false; } if(!creep.pos.isEqualTo(dropPosition)) { creep.moveTo(dropPosition); return false; } return creep.harvest(Game.getObjectById(sourceId)) == OK; }

Every active contract is executed in the end of the player loop automatically by the game. If module.exports.loop returns true, then the contract is considered executed on this tick. Each contract defines how many ticks it should last, and how much credits the client pays to the contractor (host) when the contract is done. There is also an option to pay X credits every Y successful ticks.

There will be new Contracts UI section in the side menu. There you can view your active contracts, their code and progress, view pending contract offers from other players, and create a new contract offer and send it to another player by name.